2016-07-28 52 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我没有看到滑块导航是好的 –