HTML標籤fieldset

來源:互聯網
上載者:User

標籤:des   style   http   io   ar   color   os   使用   sp   

一個不常用的HTML標籤fieldset,不過我覺得比較有意思,其文法如下:

<fieldset> <legend>fieldset名稱</legend> <!-- 加入你的內容 --> </fieldset>

下面是一個程式碼範例:

<center> <fieldset style=" width:300px"> <legend>使用者登陸</legend> <form method="post"> 帳號:<input ></input> <br><br> 密碼:<input type="password" ></input> <br><br> <input type="submit" value="登陸" ></input> &nbsp;&nbsp; <input type="reset" value="重填" ></input> </form> </fieldset> </center>

代碼的實際效果如下:

 

 

使用者登陸帳號:
密碼:

 

fieldset 標籤 -- 對錶單進行分組

  • 此標籤是成對出現的,以<fieldset>開始,以</fieldset>結束
  • 一個表單可以有多個<fieldset>,每對<fieldset>為一組,每組的內容描述可以使用<legend>說明
    <form action="http://www.dreamdu.com/dreamdu.php" method="post" enctype="multipart/form-data" id="dreamduform">    <fieldset>  <legend>使用者名稱與密碼:</legend>  <input name="hiddenField" type="hidden" value="hiddenvalue" />  <label for="username">使用者名稱:</label>  <input type="text" id="username" value="www.dreamdu.com" />  <label for="pass">密碼:</label>  <input type="password" id="pass" /> </fieldset> <fieldset>  <legend>性別:</legend>  <label for="boy">男</label>  <input type="radio" value="1" id="sex" />  <label for="girl">女</label>  <input type="radio" value="2" id="sex" />  <label for="sex">保密</label>  <input type="radio" value="3" id="sex" />   </fieldset> <fieldset>  <legend>我最喜愛的:</legend>  <label for="computer">電腦</label>  <input type="checkbox" value="1" id="fav" />  <label for="trval">旅遊</label>  <input type="checkbox" value="2" id="fav" />  <label for="buy">購物</label>  <input type="checkbox" value="3" id="fav" />   </fieldset> <fieldset>  <legend>對夢之都的意見:</legend>  <label for="select">你對夢之都的感覺</label>  <select size="1" id="select">   <option>很全面,很好</option>   <option>一般般吧,還要努力</option>   <option>有很多問題,不過還可以</option>  </select> </fieldset> <fieldset>  <legend>夢之都程式設計語言選擇:</legend>  <label for="multipleselect">你想在夢之都學習的程式設計語言</label>  <select size="10" multiple="multiple" id="multipleselect">   <option>XHTML</option>   <option>CSS</option>   <option>JAVASCRIPT</option>   <option>XML</option>   <option>PHP</option>   <option>C#</option>   <option>JAVA</option>   <option>C++</option>   <option>PERL</option>  </select> </fieldset> <fieldset>  <legend>我要在夢之都學:</legend>  <label for="WebDesign">選擇一個你在夢之都最想學的</label>  <select id="WebDesign">   <optgroup label="client">    <option value="HTML">HTML</option>    <option value="CSS">CSS</option>    <option value="javascript">javascript</option>   </optgroup>   <optgroup label="server">    <option value="PHP">PHP</option>    <option value="ASP">ASP</option>    <option value="JSP">JSP</option>   </optgroup>   <optgroup label="database">    <option value="Access">Access</option>    <option value="MySQL">MySQL</option>    <option value="SQLServer">SQLServer</option>   </optgroup>  </select> </fieldset> <fieldset>  <legend>個人化資訊:</legend>  <label for="myimage">個性照片上傳</label>  <input type="file" id="myimage" size="35" maxlength="255" />  <label for="contactus">聯絡我們</label>  <textarea cols="50" rows="10" id="contactus">   dreamer dreamdu[at]163[dot]com  </textarea> </fieldset> <fieldset>  <legend>提交:</legend>  <input type="submit" value="submit" id="submit" />  <input type="reset" value="reset" id="reset" /> </fieldset></form>下面是上面代碼的運行結果:
使用者名稱與密碼:使用者名稱: 密碼:性別:男 女 保密我最喜愛的:電腦 旅遊 購物對夢之都的意見:你對夢之都的感覺 很全面,很好 一般般吧,還要努力 有很多問題,不過還可以夢之都程式設計語言選擇:你想在夢之都學習的程式設計語言 XHTML CSS JAVASCRIPT XML PHP C# JAVA C++ PERL我要在夢之都學:選擇一個你在夢之都最想學的 HTML CSS javascript PHP ASP JSP Access MySQL SQLServer個人化資訊:個性照片上傳 聯絡我們 dreamer dreamdu[at]163[dot]com提交:

 

樣式一代碼如下:
<fieldset style="width:300;height:150;border:2px groove" align=center></fieldset>
樣式二代碼如下:
<fieldset style="width:300;height:150;border:2px red groove" align=center></fieldset>
樣式三代碼如下:
<fieldset style="width:300;height:150;border:2px red groove; </fieldset>
樣式四1234 代碼如下:
<fieldset style="width:300;height:150;border:1px dashed #ff9966" align="center" > <legend style="border:0px;"> 1234 </legend> </fieldset>
樣式五1234
代碼如下:
<fieldset style="width:300;height:150;border:1px dashed red" align="center"> <legend style="width:100px;border:1px dashed #ff9966;text-align:center;font-family:arial;font-weight:bold"> 1234 </legend> </fieldset>
樣式六
 

代碼如下:
<table border=0 cellPadding=0 cellSpacing=0 align="center"> <tr><td bgcolor=#d9d9d9> <fieldset style="width:300;height:150" align=center></fieldset> </td><tr> </table>

 

HTML標籤fieldset

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.