Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在边框中间设置图例文本field set?
field set
我试过这个html代码:
<fieldset> <legend align="center"> This is text appear at center of border </legend> </fieldset>
我也尝试过,margin-left: 100px但由于设计限制,我不想使用 margin-left。
margin-left: 100px
CSS是你的朋友
legend { width: 100%; text-align: center; }
尝试为“图例元素”提供一个百分比为 10% 的宽度。然后给它 margin-left:45% ((100-10)/2)
legend { width: 10%; text-align: center; margin-left:45%;
}
它将位于边界之间的中心