[英]CSS display: table-caption
When I set my element to display: table-caption in CSS: It brings it next to the label.当我将元素设置为 display: table-caption in CSS 时:它将它带到标签旁边。 Is there a way to keep it at the bottom?有没有办法让它保持在底部?
input, #number{ display: table-cell; } #examples{ background: red; width: 100%; position: absolute; left: 0; }
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/> <div class="input-group col-md-6"> <label class="input-group-addon" id="number">Number</label> <input type="text" class="form-control" required></input> <ul id="examples"> <li>111 111</li> <li> 11 11 11</li> </ul> </div> <div class="input-group col-md-6"> <label class="input-group-addon" id="number">Postal code</label> <input type="text" class="form-control" required></input> </div>
I do not understand why a table layout is needed here, but table-caption
can go along with caption-side
我不明白为什么这里需要表格布局,但table-caption
可以与caption-side
一起使用
The
caption-side
CSS property puts the content of a table's<caption>
on the specified side.caption-side
CSS 属性将表格的<caption>
放在指定的一侧。 The values are relative to thewriting-mode
of the table.这些值与表格的writing-mode
有关。
input, #number { display: table-cell; } .input-group { /* display:table; *//* or table-row can be set here if needed */ } #examples { background: red; margin: 0 1em; display: table-caption; caption-side: bottom; }
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/> <div class="input-group col-md-6"> <label class="input-group-addon" id="number">Number</label> <input type="text" class="form-control" required/> <ul id="examples"> <li>111 111</li> <li> 11 11 11</li> </ul> </div> <div class="input-group col-md-6"> <label class="input-group-addon" id="number">Postal code</label> <input type="text" class="form-control" required/> </div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.