0
關於這個問題有很多相同的問題,但我認爲我有不同的情況。如何讓絕對定位的父親的孩子擴大其寬度?
好的,我有一個position: fixed
與指定的寬度塊,我有絕對定位塊內。我想讓這個工具提示足夠靈活,以包含大量文本(最多2-3行)或者只是幾個字。但不超過400個像素。
我在這裏嘗試了很多屬性,並沒有運氣。也許你知道這很熱?
這裏是所有的代碼來理解風格要求:codepen.io/Grawl/pen/EazNJJ
並在很短:
.fixed {
position: fixed;
top: 34%;
right: 0;
width: 36px;
}
.absolute {
position: absolute;
top: 0;
right: 100%;
}
.absolute p {
/* what have I do here? */
}
<div class="fixed">
<div class="absolute">
<p>How to make this block parent have this block width?</p>
</div>
</div>
你的問題不清楚 –