[英]How can a fieldset be set to flex so that the legend is on the left of the content?
我想用 flex 格式化字段集/圖例,以便圖例位於字段集內容的左側。 我知道我可以float:left
傳說,但不知何故在 Safari 14 這不起作用。 我該如何解決這個問題?
fieldset { display: flex; align-items: baseline; } legend { display: block; float: left; width: 250px }
<fieldset> <legend>Should float in line with content</legend> Content </fieldset>
您可以設置父display: inline
fieldset { display: inline; } legend { float: left; width: 250px }
<fieldset> <legend align="left">Should float in line with content</legend > Content </fieldset>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.