2016-07-28 50 views
0

這是我的網站www.foxboxretail.com。在前面的橫幅滑塊有CSS代碼的問題。問題是橫幅導航展示位置因屏幕尺寸變化而變化維護屏幕分辨率變化的元素展示位置

1360px resolutionv(這是完美的)

enter image description here

1920px分辨率(滑塊的導航位置改變。)

enter image description here 在上圖中可以看到導航變得稍上方這混亂設計。我如何維護所有屏幕尺寸?

CSS

.slide-part{ 
    width:100%; 
    max-width:1600px; 
    margin:10px auto 0 auto; 
    min-height:100px; 
    max-height:400px; 
    position:relative 
} 

.fadein { 
    padding-top: 27%; 
    position:relative; 
    width:100%; 
    max-width:1600px; 
    margin:0 auto; 
    min-height:60px; 
} 

.fadein img { 
    position:absolute; 
    left:0; 
    top:0; 
    bottom:0; 
    right:0; 
    width:100%; 
    width: auto\9; 
    object-fit:fill; 
    height:400px 
} 

.banner-links { 
    position: absolute; 
    bottom: 0; 
    width: 100%; 
    background: rgba(0,0,0,0.6); 
} 

.banner-links-inner { 
    width:auto; 
    max-width:1000px; 
    margin: 0 auto 0 auto; 
} 

.banner-nav { 
    margin: 0; 
    padding: 0; 
} 

.banner-nav li { 
    list-style: none; 
    float: left; 
    font-size: 1.2em; 
} 

.banner-nav li a { 
    color: #fff; 
    text-decoration: none; 
    padding: 15px 50px 15px 50px; 
    display: block; 
    border-right: 1px solid #fff; 
} 

HTML

<div class="slide-part"> 
     <!--slider-starts--> 
     <div class="fadein"> 

      <img id="img01" style="cursor: pointer; display: block;" src="images/products/1.jpg" /> 
      <img id="img02" style="cursor: pointer; display: none;" src="images/products/2.jpg" /> 
      <img id="img03" style="cursor: pointer; display: none;" src="images/products/3.jpg" /> 
      <img id="img04" style="cursor: pointer; display: none;" src="images/products/4.jpg" /> 
     </div> 
     <!--slide-ends--> 
     <div class="banner-links"> 
      <div class="banner-links-inner"> 
       <ul class="banner-nav"> 
        <li><a class="img1 current" data-id="img01" href="#">Helicopter Tour Mumbai</a></li> 
        <li><a class="img2" data-id="img02" href="#">JBL Flip II Offer</a></li> 
        <li><a class="img3" data-id="img03" href="#">Dominos 20% Off</a></li> 
        <li class="no-border"><a class="img4" data-id="img04" href="#">Paragliding</a></li> 
       </ul> 
      </div> 
     </div> 
    </div> 
+0

你想要它在哪裏?居中?你現在有浮動:正確的,所以整個div浮動正確.... –

+0

@GeorgePant你可以告訴我你在哪裏浮動:正確和哪個元素? – SUN

+0

@GeorgePant其實我的橫幅圖片尺寸是1920px X 468px。所以這個決議看起來不錯。在我的CSS中,我一直保持物體貼合度:在1360分辨率下覆蓋圖像從屏幕出來。我怎樣才能避免這種情況?這隻有在媒體查詢時纔有可能? – SUN

回答

0

添加最大高度,以您的滑塊的圖像應該做你想要什麼。

.fadein img { 
max-height:468px; 
} 
+0

對不起。但我認爲你錯了我的問題。沒有頂級菜單的問題。正如你可以在我的第二個圖像中看到滑塊導航那裏。你可以看到它的黑色透明菜單略微上滑塊有我有問題。 – SUN

+0

o對此感到抱歉...您使用的是什麼瀏覽器?在鉻和1920px我沒有看到滑塊導航是好的 –