繁体   English   中英

如何将字段集设置为 flex 以使图例位于内容的左侧?

[英]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.

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