哪个CSS标签创建一个像这样的框与标题?
问题描述:
我想使用标题创建一个这样的框:
I want to create a box like this with title:
任何人都可以告诉我是否有一个默认的CSS标签来做这个?
Can any one please let me know if there is a default CSS tag to do this? Or do I need to create my custom style?
答
我相信你正在寻找 fieldset
HTML标记,然后您可以使用CSS样式。例如
I believe you are looking for the fieldset
HTML tag, which you can then style with CSS. E.g.,
<fieldset style="border: 1px black solid">
<legend style="border: 1px black solid;
margin-left: 1em; padding: 0.2em 0.8em ">title</legend>
Text within the box <br />
Etc
</fieldset>