0
我被困在試圖弄清楚,爲什麼如果我相對定位內嵌塊選擇元素,因爲它是下面的結構,它忽略了百分比的頂部偏移屬性(在ems中,對於前,沒有問題)。如果沒有p
標籤,則偏移量%起作用。但一旦p標籤回來,top
%不起作用。謝謝。爲什麼內嵌塊位置:相對忽略頂部偏移量的百分比?
html, body {
height: 100%;
}
select {
position: relative;
top: 10%;
}
<body>
<p>some text</p>
<select>
<option>apples</option>
</select>
<p>some text</p>
</body>
謝謝!有趣的是Chrome如何忽略它。不知道。 –