主頁(yè) > 知識(shí)庫(kù) > 網(wǎng)頁(yè)設(shè)計(jì)之5種簡(jiǎn)單的XHTML網(wǎng)頁(yè)表單

網(wǎng)頁(yè)設(shè)計(jì)之5種簡(jiǎn)單的XHTML網(wǎng)頁(yè)表單

熱門(mén)標(biāo)簽:中國(guó)世界文化遺產(chǎn)地圖標(biāo)注 可以集成到系統(tǒng)的外呼 荊州銷售電銷機(jī)器人 電腦外呼系統(tǒng)安裝 外呼系統(tǒng)隱私 電話外呼系統(tǒng)怎么找準(zhǔn)客戶 揚(yáng)州市地圖標(biāo)注 400開(kāi)頭電話在哪辦理 西安公司外呼系統(tǒng)價(jià)格

網(wǎng)頁(yè)設(shè)計(jì)之5中簡(jiǎn)單的XHTML網(wǎng)頁(yè)表單。 技術(shù)1:標(biāo)簽三明治
將輸入框,選擇框和文本框全部包含進(jìn) label 元素,并全部設(shè)置為塊級(jí)元素。將單選按鈕和多選框顯示方式設(shè)置為 inline 以便于它們?cè)谕恍谐霈F(xiàn)。如果你比較喜歡 label 和單選按鈕/多選框出現(xiàn)在不同行,可以選擇不把它包含在 label 里面,或者使用硬換行處理。
每種情況都在下面展示了。

當(dāng)這些看起來(lái)比較時(shí)髦的時(shí)候,W3C 事實(shí)上已經(jīng)含蓄地展示了他們的 label 例子。
主要好處:簡(jiǎn)單
代碼:
label, input, select, textarea {display: block;} label {margin-bottom: 10px;} input[type="radio"], input[type="checkbox"] {display: inline;} <form> <fieldset> <legend>Contact Form</legend> <label for="name"> Name</label> <input id="name" name="name" size="20" /> <label for="email">Email</label> <input id="email" name="email" size="20" /> <label for=" Choices"> Choices (radio) — <em>wrapped label</em></label> <input name=" Choice" type="radio" /> Choice 1 <input name=" Choice" type="radio" /> Choice 2 <input name=" Choice" type="radio" /> Choice 3 <label style="margin-bottom: 0pt;" for=" Choices2"> Choices (checkbox) — <em>non-wrapped label, margin reset</em></label> <input name=" Choice2" type="checkbox" /> Choice 1 <input name=" Choice2" type="checkbox" /> Choice 2 <input name=" Choice2" type="checkbox" /> Choice 3 <div style="height: 10px;"><!-- just to split the demo up --></div> <label for=" Choices3"> Choices (checkbox) — <em>wrapped, hard line-break</em></label> <input name=" Choice3" type="checkbox" /> Choice 1 <input name=" Choice3" type="checkbox" /> Choice 2 <input name=" Choice3" type="checkbox" /> Choice 3 <label for="dropdown"> Question</label> <select id="dropdown"> <optgroup label="Group of Options"></optgroup> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select> <label for="message"> Message <textarea cols="36" rows="12" name="message"></textarea> </label> <input type="submit" value="send it" /> </fieldset> </form>
運(yùn)行結(jié)果
#expamle1 label,#expamle1 input,#expamle1 select,#expamle1 textarea {display: block;}
#expamle1 label {margin-bottom: 10px;}
#expamle1 input[type="radio"],#expamle1 input[type="checkbox"] {display: inline;}
技術(shù)2:懶人
許多開(kāi)發(fā)者采用了這種不正統(tǒng)但是快速簡(jiǎn)單(用換行隔斷標(biāo)記)的方法。雖然能運(yùn)行,但是對(duì)你的 css 能力有害,因?yàn)槟悴恍枰魏?css 去實(shí)現(xiàn)它。
主要好處:快速
代碼:
<form> <fieldset> <legend>Contact Form</legend> <label for="name">Name</label> <input id="name" name="name" size="20" /> <label for="email">Email</label> <input id="email" name="email" size="20" /> <label for=" Choices"> Choices (radio)</label> <input name=" Choice" type="radio" /> Choice 1 <input name=" Choice" type="radio" /> Choice 2 <input name=" Choice" type="radio" /> Choice 3 <label for=" Choices3"> Choices (checkbox)</label> <input name=" Choice3" type="checkbox" /> Choice 1 <input name=" Choice3" type="checkbox" /> Choice 2 <input name=" Choice3" type="checkbox" /> Choice 3 <label for="dropdown">Question</label> <select id="dropdown"> <optgroup label="Group of Options"></optgroup> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select> <label for="message">Message</label> <textarea cols="36" rows="12" name="message"></textarea> <input type="submit" value="send it" /> </fieldset> </form>
運(yùn)行結(jié)果
上一頁(yè)12 下一頁(yè) 閱讀全文

標(biāo)簽:樂(lè)山 錫林郭勒盟 白銀 濟(jì)南 阿拉善盟 延安 貴陽(yáng) 四川

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《網(wǎng)頁(yè)設(shè)計(jì)之5種簡(jiǎn)單的XHTML網(wǎng)頁(yè)表單》,本文關(guān)鍵詞  網(wǎng)頁(yè)設(shè)計(jì),之,5種,簡(jiǎn)單,的,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《網(wǎng)頁(yè)設(shè)計(jì)之5種簡(jiǎn)單的XHTML網(wǎng)頁(yè)表單》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于網(wǎng)頁(yè)設(shè)計(jì)之5種簡(jiǎn)單的XHTML網(wǎng)頁(yè)表單的相關(guān)信息資訊供網(wǎng)民參考!
  • 企业400电话

    智能AI客服机器人
    15000

    在线订购

    合计11份范本:公司章程+合伙协议+出资协议+合作协议+股权转让协议+增资扩股协议+股权激励+股东会决议+董事会决议

    推薦文章