0
嗨 - 是否有可能有一個高度等於流體寬度的div展開以在窄視口內包含其內容?高度等於動態寬度(CSS流體佈局)+展開以包含溢出
我想出了一個變通用純色的div:http://jsfiddle.net/2nprw0xq/
但不能與邊框:http://jsfiddle.net/534k9e2n/
下面是我使用的代碼。謝謝,B。
<div class="holder">
<div class="shape"></div>
<div class="shape_outer">
<div class="shape_inner"> Text... </div>
</div>
</div>
。
.holder {
display: inline-block;
position: relative;
width: 50%;
}
.shape {
margin-top: 100%;
}
.shape_outer {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
border: 1px solid #111;
}
.shape_inner {
padding: 20px;
}
真棒。謝謝@caeth。 – boyce 2014-09-26 21:29:12
@boyce接受嗎? :) – 2014-09-26 21:33:23
Soz :) ......... – boyce 2014-09-26 21:53:25