我想用flex格式化FieldSet/legend,使legend位于FieldSet内容的左侧。我知道我可以float:left
这个图例,但在Safari14中,这不起作用。我怎样才能避开这个问题呢?
null
fieldset {
display: flex;
align-items: baseline;
}
legend {
display: block;
float: left;
width: 250px
}
<fieldset>
<legend>Should float in line with content</legend>
Content
</fieldset>
null
这就是你的目标?
null
fieldset {
display: flex;
justify-content: space-between;
align-items: baseline;
}
<fieldset>
<div>Should float in line with content</div>
<div>Content</div>
</fieldset>