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>。
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); }
<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边框样式设置的详细内容,更多请关注其它相关文章!
推荐阅读
-
html中fieldset边框样式设置
-
黄聪:CSS+DIV 设置圆角边框加阴影效果_html/css_WEB-ITnose
-
如何设置网页中的一段文字,使它的宽度是页面宽度的62%且能自动换行?_html/css_WEB-ITnose
-
能否实现对特定字符设置样式?_html/css_WEB-ITnose
-
css中如果没有设置display,则无法显示动画效果!_html/css_WEB-ITnose
-
不知大家遇到过这种问题么,一个层宽度设为100%,并设置背景图片,在浏览器中浏览,缩小窗口到滚动条出现,然后拖动滚动条到右侧,右侧的区域变成空白,怎么解决?_html/css_WEB-ITnose
-
html5中设置或返回音视频是否在加载后即开始播放的属性autoplay
-
使用css3背景渐变中的透明度来设置不同颜色的背景渐变_html/css_WEB-ITnose
-
html中table为每个单元格设置不同颜色和宽度_HTML/Xhtml_网页制作
-
html中怎么设置字体透明度