[英]Why is padding not calculated inside the height of the display flex container
.wrap { display: flex; flex-flow: column; }.row { display: flex; flex-flow: row wrap; background: yellow; } group label { padding: 1em; background: red; }
<div class='wrap'> <h2> Header </h2> <div class='row'> <group> <label> Label </label> </group> </div> </div>
為什么這個填充不在容器的計算高度內。
默認情況下,標簽是顯示內聯塊。 將其設置為默認塊
.wrap { display: flex; flex-flow: column; }.row { display: flex; flex-flow: row wrap; background: yellow; } group label { padding: 1em; background: red; display:block }
<div class='wrap'> <h2> Header </h2> <div class='row'> <group> <label> Label </label> </group> </div> </div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.