ieldset元素用於對表單中的元素進行分組並在文檔中區別標出文本。它與窗口框架的行為有些相似。在 Internet Explorer 4.0 及以上版本的HTML 和的腳本中可用。
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); }
效果圖:
和正常的塊級元素很像,可以對其邊框、背景、字體等作出設置。
參考文章地址