我想我的格對齊像下圖所示的....無法使用所有的方法後得到div的期望溢出建議
但我得到這樣的事情.. ...
只有固定定位爲我工作...但我不希望使用....
這裏是我的html代碼...
<div class="profileHeader">
<span class="img" style="background: url(http://localhost/Amar/public/assets/images/temp/restaurant.jpeg) #B3E5FC center center/cover no-repeat;"></span>
<span class="gradientBottom"></span>
<div class="col-lg-3">
<div class="profilePicWrapper">
<div class="profilePic">
<img src="assets/images/temp/shop.jpg" alt="Alt here"/>
</div>
</div>
</div>
</div>
<div class="optionWrapper"></div>
這裏是我的CSS代碼....
.profileHeader {
height: 400px;
position: relative;
}
.profileHeader .gradientBottom {
left: 0;
bottom: 0;
width: 100%;
height: 50%;
position: absolute;
background: -moz-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,0) 20%,rgba(0,0,0,.5) 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(0,0,0,0)),color-stop(20%,rgba(0,0,0,.13)),color-stop(100%,rgba(0,0,0,.5)));
background: -webkit-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,0) 20%,rgba(0,0,0,.5) 100%);
background: -o-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,0) 20%,rgba(0,0,0,.5) 100%);
background: -ms-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,0) 20%,rgba(0,0,0,.5) 100%);
background: linear-gradient(to bottom,rgba(0,0,0,0) 0,rgba(0,0,0,0) 20%,rgba(0,0,0,.5) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#a6000000', GradientType=0);
}
.profilePicWrapper {
position: relative;
width: 100%;
height: 100%;
z-index: 1;
}
.profilePic {
width: 100%;
padding: 5px;
background-color: #fff;
border: 1px solid #999;
position: absolute;
z-index: 10;
margin-top: 200px;
}
.profilePic img {
width: 100%;
display: block;
}
.optionWrapper {
width: 100%;
height: 50px;
background: #fff;
text-align: center;
position: relative;
border-bottom: 1px solid #414042;
}
我無法弄清楚什麼錯誤......請幫助.. 。
爲什麼你不想使用固定定位? – TricksfortheWeb
我的網站是響應和很多調整是需要處理固定定位..... – Prateek
我認爲這將是類似的東西。你可以把圖像放在[imgur](http://imgur.com)上,這樣我就可以在小提琴中使用它們了嗎? – TricksfortheWeb