简体   繁体   English

带下划线的字段集图例

[英]Underlined Fieldset Legend

I am working on a small interface, and currently have a simple set of radio buttons inside a fieldset with a legend. 我正在使用一个小型界面,目前在带有图例的字段集中有一组简单的单选按钮。 It currently looks like this: 当前看起来像这样:

现在是什么

But I want to get a border between the legend and the buttons, like so: 但我想在图例和按钮之间找到一个边界,如下所示:

我想要什么

The code is as follows: 代码如下:

<fieldset>
  <legend>Size:</legend>
  <label>
    <input type="radio" name="size" value="small" checked="checked" /> Small
  </label>
  <label>
    <input type="radio" name="size" value="medium" /> Medium
  </label>
  <label>
    <input type="radio" name="size" value="big" /> Big
  </label>
</fieldset>

Any advice would be appreciated! 任何意见,将不胜感激!

Try this: 尝试这个:

fieldset { 
  border: none;
}
legend {
  border-bottom: 1px solid black;
  padding: 2px 0px;
  width: 100%;
}

Demo 演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM