Как центрировать мое изображение в SliderFrame - PullRequest
0 голосов
/ 02 ноября 2018

Я схожу с ума от этого !!

Я просто хочу всегда центрировать изображения в слайдере. Я перепробовал все, что нашел, и я просто могу это сделать!

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;
}
...