ホームページにスライダー画像があります
何らかの理由で、Firefox と Safari で画像が右側に表示されます。Chromeでは、本来の中央に表示されています。
これはポジショニングにかかっていると思いますが、私が試した変更は大いに役立つようです.
誰でもアイデアはありますか?
CSS を次のように変更します。
#slider-container{
width:960px;
position: relative;
overflow:hidden;
height:300px;
z-index:100;
border-bottom:1px solid #2b292d; padding-bottom:20px;
text-align: center;
margin: 0px auto;
}
#content-wrapper{ position:relative; z-index:200; bottom:-50px;}
要素のmarginプロパティをに0 auto
設定してから、親要素のtext-align
プロパティをに設定しますcenter
…………
こんにちは、スライド ID を定義し、のleft 50%
に渡しますmargin-left: - half
slider width
このように。
#slider-container{
left:50%;
margin-left:-480px; // total width of 980px half
}