html - CSS3 for HTML5 Legend inside 字段集

标签 html css gradient fieldset

能否请您建议 CSS 以获得如下引用的效果(使用 CSS3 渐变和边框)?

enter image description here

HTML 的当前版本如下:

<section style="margin: 10px;">
<fieldset style="border-radius: 5px; padding: 5px; min-height:150px;">
<legend><b> My Statistics </b> </legend>
<label> <br/> </label>
<label> <br/> </label>
</fieldset>

最佳答案

fieldset {
    font-family: sans-serif;
    border: 5px solid #1F497D;
    background: #ddd;
    border-radius: 5px;
    padding: 15px;
}

fieldset legend {
    background: #1F497D;
    color: #fff;
    padding: 5px 10px ;
    font-size: 32px;
    border-radius: 5px;
    box-shadow: 0 0 0 5px #ddd;
    margin-left: 20px;
}
<section style="margin: 10px;">
<fieldset style="min-height:100px;">
<legend><b> My Statistics </b> </legend>
<label> <br/> </label>
<label> <br/> </label>
</fieldset>

( http://jsfiddle.net/ESkRt/1/ )

关于html - CSS3 for HTML5 Legend inside 字段集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19774653/

相关文章:

javascript - 如何在谷歌地图上添加窗帘

html - 溢出 x : auto element 内的 100% 宽度

python - Materialise css 'select' 不适用于 django

python - 每个直方图曲线下方的渐变填充 - Python

html - 禁用 Firefox 上的复选框

html - 在相对元素内水平居中绝对元素

html - 响应式设计改变div的顺序和位置

html - ie7 不显示 css 规则,除非我在开​​发人员工具中再次打开和关闭它

matlab - 我想使用 Matlab 对卫星轨迹图进行颜色编码

Css 给 Element + Before 添加渐变