用这个 html:
<h2>Where (Location / Station)</h2>
<label for="selwhere">Select the locations for the job type selected above</label>
<select name="selwhere" id="selwhere" multiple="multiple">
<option value="linecook">Line cook</option>
<option value="barrista">Barrista</option>
<option value="securityguard">Security Guard</option>
<option value="fignipper">Nipper of Figs</option>
</select>
我的标签落到选择元素的底部:
我希望它位于顶部。我需要什么 html 或 CSS?
最佳答案
只需使用 vertical-align:top
:
label {
vertical-align: top;
}
<label for="selwhere">Select the locations for the job type selected above</label>
<select name="selwhere" id="selwhere" multiple="multiple">
<option value="linecook">Line cook</option>
<option value="barrista">Barrista</option>
<option value="securityguard">Security Guard</option>
<option value="fignipper">Nipper of Figs</option>
</select>
关于html - 如何让标签停留在选择元素的顶部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32040259/