我有一個文本和圖像之間分割50%的股利。我希望右邊的圖像始終與文字高度相同,今天早上我一直在關注很多帖子,但似乎無法使其發揮作用。在響應Div分裂50%全高度圖像
您可以看到頁面在這裏的一個例子: http://pagedev.co.uk/bowmite/test/electrical.html
我覺得我幾乎那裏,你可以看到橙色背景,顯示div的基地。像正好需要適應下來這和溢出需要的地方......
我的HTML是:
<div class="split-wrapper">
<div class="split-left">
<p>Our focus is quality, pure and simple. We strive to retain our high standards and reputation whilst learning from each successful high quality installation. Implementating control procedures within an ever changing market place has been key to our success.</p>
<p>You will find our site teams are efficiently supervised with high levels of management availability and client liaison. We enjoy long term relationships with many of our clients, thanks to our comprehensive understanding of quality.</p>
</div>
<div class="split-right">
<img class="right-align-image" src="images/electrical-bottom.jpg">
</div>
</div>
我的CSS是:
.split-wrapper {
width:100%;
height:auto;
background-color:#ff6600;
margin-bottom:20px;
display:inline-block;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-khtml-border-radius: 4px;
}
.split-left {
width:40%;
height:100%;
padding-right:5%;
padding-left:5%;
padding-top:25px;
padding-bottom:15px;
display:inline-block;
float:left;
background-color:#ffffff;
-moz-border-radius-topleft: 4px;
-moz-border-radius-topright: 0px;
-moz-border-radius-bottomright: 0px;
-moz-border-radius-bottomleft: 4px;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 0px;
-webkit-border-bottom-right-radius: 0px;
-webkit-border-bottom-left-radius: 4px;
}
.split-right {
width:50%;
height:auto;
float:left;
background-color:#ffffff;
overflow:hidden;
-moz-border-radius-topleft: 0px;
-moz-border-radius-topright: 4px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 0px;
-webkit-border-top-left-radius: 0px;
-webkit-border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 0px;
}
.split-right img {
width:;
-moz-border-radius-topleft: 0px;
-moz-border-radius-topright: 4px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 0px;
-webkit-border-top-left-radius: 0px;
-webkit-border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 0px;
}
我相信你將需要使用jQuery了點。 – 2014-10-30 12:01:50
設置父'身高:100%'和圖像'身高:100%,寬度:自動',但圖像的某些部分將隱藏 – 2014-10-30 12:12:07