【发布时间】:2021-08-13 03:27:02
【问题描述】:
我有一个带有字段集的表单,并希望保留边框,但希望在某些文本图例之间显示边框。我无法让图例具有透明背景以让边框通过(被某些文本元素阻挡)。
legend {
display:flex;
justify-content:space-between;
width: 100%;
background-color: transparent;
}
legend div {
background-color: white;
margin-left:0.5em;
margin-right:0.5em;
}
<form>
<fieldset>
<legend><div>Form Item</div><div>(extra 1)</div></legend>
<label>Input:</label><input></input>
</fieldset>
</form>
【问题讨论】:
-
background: linear-gradient(black ,black) center / 100% 1px no-repeat;<legend>