Fieldset 一个不常用的HTML标签

10:31:44fieldset是一个不常用的HTML标签,很有意思,其语法如下:
<fieldset>
<legend>fieldset名称</legend>
<!-- 加入你的内容 -->
</fieldset>
在IE中,如果不加css,fieldset的效果是圆角的,但加了css后就变成方角的了。
在Firefox中的效果都为方角。

示例如下:
以下是代码片段:

None.gif < fieldset >< legend > 本站公告 </ legend >   
None.gif欢迎光临本站!soking’s desk.  
None.gif
</ fieldset >   
None.gif
None.gif
< fieldset  style ="width:300px; border : 1px solid #ff9900;text-align:left;COLOR:#ff9900;FONT-SIZE:   
None.gif12px;font-family: Verdana;padding:5px;"
>   
None.gif
< legend > 本站公告 </ legend >   
None.gif欢迎光临本站!soking’s desk.  
None.gif
</ fieldset >  
None.gif


示例2(登录框):
以下是代码片段:

None.gif < center >   
None.gif
< fieldset  style ="width:300px" >   
None.gif
< legend > 用户登陆 </ legend >   
None.gif
< form  name ="login"  method ="post" >   
None.gif帐号:
< input  name ="UserName" ></ input >   
None.gif
< br >< br >   
None.gif密码:
< input  type ="password"  name ="UserPassword" ></ input >   
None.gif
< br >< br >   
None.gif
< input  type ="submit"  value ="登陆"  name ="Submit" ></ input >   
None.gif    
None.gif
< input  type ="reset"  value ="重填"  name ="Reset" ></ input >   
None.gif
</ form >   
None.gif
</ fieldset >   
None.gif
</ center >   
None.gif
None.gif
None.gif
None.gif

实例一:

None.gif <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
None.gif
< html  xmlns ="http://www.w3.org/1999/xhtml" >
None.gif
< head >
None.gif
< meta  http-equiv ="Content-Type"  content ="text/html; charset=gb2312"   />
None.gif
< title > Form demo </ title >
ExpandedBlockStart.gifContractedBlock.gif
< style  type ="text/css" > dot.gif
InBlock.gif<!--
ExpandedSubBlockStart.gifContractedSubBlock.gifbody 
{dot.gif}{
InBlock.giffont-family
: Arial, Helvetica, sans-serif;
InBlock.giffont-size
:12px;
InBlock.gifcolor
:#666666;
InBlock.gifbackground
:#fff;
InBlock.giftext-align
:center;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.gif
{dot.gif}{
InBlock.gifmargin
:0;
InBlock.gifpadding
:0;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.gif
{dot.gif}{
InBlock.gifcolor
:#1E7ACE;
InBlock.giftext-decoration
:none;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.gifa:hover 
{dot.gif}{
InBlock.gifcolor
:#000;
InBlock.giftext-decoration
:underline;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.gifh3 
{dot.gif}{
InBlock.giffont-size
:14px;
InBlock.giffont-weight
:bold;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.gifpre,p 
{dot.gif}{
InBlock.gifcolor
:#1E7ACE;
InBlock.gifmargin
:4px;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.gifinput, select,textarea 
{dot.gif}{
InBlock.gifpadding
:1px;
InBlock.gifmargin
:2px;
InBlock.giffont-size
:11px;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.gif.buttom
{dot.gif}{
InBlock.gifpadding
:1px 10px;
InBlock.giffont-size
:12px;
InBlock.gifborder
:1px #1E7ACE solid;
InBlock.gifbackground
:#D0F0FF;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.gif#formwrapper 
{dot.gif}{
InBlock.gifwidth
:450px;
InBlock.gifmargin
:15px auto;
InBlock.gifpadding
:20px;
InBlock.giftext-align
:left;
InBlock.gifborder
:1px #1E7ACE solid;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.giffieldset 
{dot.gif}{
InBlock.gifpadding
:10px;
InBlock.gifmargin-top
:5px;
InBlock.gifborder
:1px solid #1E7ACE;
InBlock.gifbackground
:#fff;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.giffieldset legend 
{dot.gif}{
InBlock.gifcolor
:#1E7ACE;
InBlock.giffont-weight
:bold;
InBlock.gifpadding
:3px 20px 3px 20px;
InBlock.gifborder
:1px solid #1E7ACE;
InBlock.gifbackground
:#fff;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.giffieldset label 
{dot.gif}{
InBlock.giffloat
:left;
InBlock.gifwidth
:120px;
InBlock.giftext-align
:right;
InBlock.gifpadding
:4px;
InBlock.gifmargin
:1px;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.giffieldset div 
{dot.gif}{
InBlock.gifclear
:left;
InBlock.gifmargin-bottom
:2px;
ExpandedSubBlockEnd.gif
}

ExpandedSubBlockStart.gifContractedSubBlock.gif.enter
{dot.gif}{ text-align:center;}
ExpandedSubBlockStart.gifContractedSubBlock.gif.clear 
{dot.gif}{
InBlock.gifclear
:both;
ExpandedSubBlockEnd.gif
}

ExpandedBlockEnd.gif-->
None.gif
</ style >
None.gif
</ head >
None.gif
< body >
None.gif
< div  id ="formwrapper" >
None.gif
< h3 > 已注册用户登录 </ h3 >
None.gif
< form  action =""  method ="post"  name ="apLogin"  id ="apLogin" >
None.gif
< fieldset >
None.gif
< legend > 用户登录 </ legend >
None.gif
< div >
None.gif
< label  for ="Name" > 用户名 </ label >
None.gif
< input  type ="text"  name ="Name"  id ="Name"  size ="18"  maxlength ="30"   />< br  />
None.gif
</ div >
None.gif
< div >
None.gif
< label  for ="password" > 密码 </ label >
None.gif
< input  type ="password"  name ="password"  id ="password"  size ="18"  maxlength ="15"   />< br  />
None.gif
</ div >
None.gif
< div  class ="cookiechk" >
None.gif
< label >< input  type ="checkbox"  name ="CookieYN"  id ="CookieYN"  value ="1"   />   < href ="#"  title ="选择是否记录您的信息" > 记住我 </ a ></ label >
None.gif
< input  name ="login791"  type ="submit"  class ="buttom"  value ="登录"   />
None.gif
</ div >
None.gif
< div  class ="forgotpass" >< href ="#" > 您忘记密码? </ a ></ div >
None.gif
</ fieldset >
None.gif
</ form >< br  />
None.gif
< h3 > 未注册创建帐户 </ h3 >
None.gif
< form  action =""  method ="post"  name ="apForm"  id ="apForm" >
None.gif
< fieldset >
None.gif
< legend > 用户注册 </ legend >
None.gif
< p >< strong > 您的电子邮箱不会被公布出去,但是必须填写. </ strong >  在您注册之前请先认真阅读服务条款. </ p >
None.gif
< div >
None.gif
< label  for ="Name" > 用户名 </ label >
None.gif
< input  type ="text"  name ="Name"  id ="Name"  value =""  size ="20"  maxlength ="30"   />
None.gif*(最多30个字符)
< br  />
None.gif
</ div >
None.gif
< div >
None.gif
< label  for ="Email" > 电子邮箱 </ label >
None.gif
< input  type ="text"  name ="Email"  id ="Email"  value =""  size ="20"  maxlength ="150"   />  * < br  />
None.gif
</ div >
None.gif
< div >
None.gif
< label  for ="password" > 密码 </ label >
None.gif
< input  type ="password"  name ="password"  id ="password"  size ="18"  maxlength ="15"   />
None.gif*(最多15个字符)
< br  />
None.gif
</ div >
None.gif
< div >
None.gif
< label  for ="confirm_password" > 重复密码 </ label >
None.gif
< input  type ="password"  name ="confirm_password"  id ="confirm_password"  size ="18"  maxlength ="15"   />
None.gif*
< br  />
None.gif
</ div >
None.gif
< div >
None.gif
< label  for ="AgreeToTerms" > 同意服务条款 </ label >
None.gif
< input  type ="checkbox"  name ="AgreeToTerms"  id ="AgreeToTerms"  value ="1"   />
None.gif
< href ="#"  title ="您是否同意服务条款" > 先看看条款? </ a >  *  </ div >
None.gif
< div  class ="enter" >
None.gif
< input  name ="create791"  type ="submit"  class ="buttom"  value ="提交"   />
None.gif
< input  name ="Submit"  type ="reset"  class ="buttom"  value ="重置"   />
None.gif
</ div >
None.gif
< p >< strong > * 在提交您的注册信息时, 我们认为您已经同意了我们的服务条款. < br  />
None.gif* 这些条款可能在未经您同意的时候进行修改.
</ strong ></ p >
None.gif
</ fieldset >
None.gif
</ form >
None.gif
</ div >
None.gif
</ body >
None.gif
</ html >  

  xg.jpg

转载于:https://www.cnblogs.com/net123/archive/2008/05/26/1207312.html