我为此感到疯狂!
我只想始终将图像居中放在滑块中。我已经尝试了所有发现的东西,但我可以做到!
html
<div id="sliderFrame">
<div id="slider" >
<img src="images/headers/header_1_1.jpg" alt="" class="center"/>
<img src="images/headers/header_2_1.jpg" alt="" class="center"/>
<img src="images/headers/header_3_1.jpg" alt="" class="center"/>
<img src="images/headers/header_4_1.jpg" alt="" class="center"/>
<img src="images/headers/header_5_1.jpg" alt="" class="center"/>
</div>
CSS
#sliderFrame {
position:relative;
width:95;
height:220px;/* Make it the same size as your images */
margin: 0 auto;
z-index:2
}
#slider {
z-index:3;
width:100%;
height:200px;/* Make it the same size as your images */
background:#fff url(../images/loading.gif) no-repeat 50% 50%;
position:relative;
margin:0 auto; /*this makes the image slider center-aligned. Remove this line if you want to align the whole slider to the left side*/
}
#slider img {
position:absolute;
border:none;
display:none;
}