欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

html中fieldset边框样式设置

程序员文章站 2024-01-01 10:50:46
...
或许你想到可以用图片来实现这样的效果,但图片除了体积稍大,语义上也很欠缺。这样的效果如何用xhtml+css实现呢?首先我们通过 fieldset设置一个方框(也译作域),然后通过特定的标签legend域标题,设置一个标题,并对它们进行相应的样式定义即可实现这样效果。我们首 先来了解一下fieldset方框、legend域标题这两个标签的知识。
HTML元素 fieldset方框
  Draws a box around the text and other elements that the field set contains.
  在字段集包含的文本和其它元素外面画一个方框。
  fieldset元素用于对表单中的元素进行分组并在文档中区别标出文本。它与窗口框架的行为有些相似。fieldset在 Internet Explorer 4.0 及以上版本的HTML 和的脚本中可用。
  fieldset元素元素是块元素。 并且需要关闭标签,即必须成对出现:<fieldset></fieldset>。
form#staff_info fieldset {  
    background: rgba(255,255,255,.3);  
    border-color: rgba(255,255,255,.6);  
    border-style: solid;  
    border-width: 2px;  
    -moz-border-radius: 5px;  
    -webkit-border-radius: 5px;  
    -khtml-border-radius: 5px;  
    border-radius: 5px;  
    line-height: 30px;  
    list-style: none;  
    padding: 5px 10px;  
    margin-bottom: 2px;  
}  
  
  
form#staff_info fieldset legend {  
    color:#302A2A;  
    font: bold 16px/2 Verdana, Geneva, sans-serif;  
    font-weight: bold;  
    text-align: left;  
    text-shadow: 2px 2px 2px rgb(88, 126, 156);  
}

html中fieldset边框样式设置

<fieldset style="border-width: 1px; border-color: #008000; width:95%; height:220">
<legend>系统使用说明</legend>
</fieldset>

其中border-width: 1px;是边的粗细,border-color: #008000;为边色,最好给他一个border-width: 1px;这个值不然会显不出来想要的粗细的.

 样式标签为:border-bottom-color,是设置底部边框颜色的,其它三个边框则把中间的bottom分别改为Top(上部)、Left(左部)、Right(右部)即可。

以上就是html中fieldset边框样式设置的详细内容,更多请关注其它相关文章!

上一篇:

下一篇: