[英]Move Nav Menu to overlay on top of the Slider - CSS
I am working on this site: http://jillianssf.com/dev/ 我正在此站点上工作: http : //jillianssf.com/dev/
I am trying to get the nav menu to appear above the slider like here: 我正在尝试使导航菜单显示在滑块上方,如下所示:
The problem is that I can't get it to move up. 问题是我无法让它向上移动。 I have tried adding the following CSS:
我尝试添加以下CSS:
header { margin-top: -60px;}
and/or
.nav-main { margin-top: -60px;}
to the site but it doesn't raise it up. 到网站上,但并没有提高它。 I think it is because right above the nav menu HTML is a
clear:both
div. 我认为这是因为导航菜单HTML上方的内容很
clear:both
div。
Top of page HTML: 页面顶部HTML:
<div style="margin: 0 auto; max-width: 1920px;" class="ss2-align"><script type="text/javascript">
window['nextend-smart-slider-1-onresize'] = [];
</script>
<div data-phonefontsize="20" data-tabletfontsize="16" data-desktopfontsize="12" data-allfontsize="12" style="font-size: 8.7px; transform: translate3d(0px, 0px, 0px) perspective(1000px); margin: 0px; width: 1392px; height: 674px;" class="nextend-slider-fadeload nextend-desktop nextend-loaded" id="nextend-smart-slider-1">
<!-- SLIDER CODE IS HERE -->
</div>
<script type="text/javascript">
njQuery(document).ready(function () {
njQuery('#nextend-smart-slider-1').smartslider({"translate3d":1,"playfirstlayer":0,"mainafterout":1,"inaftermain":1,"fadeonscroll":0,"autoplay":1,"autoplayConfig":{"duration":8000,"counter":0,"autoplayToSlide":0,"stopautoplay":{"click":1,"mouseenter":1,"slideplaying":1},"resumeautoplay":{"mouseleave":0,"slideplayed":1,"slidechanged":0}},"responsive":{"downscale":1,"upscale":0,"maxwidth":3000,"basedon":"combined","screenwidth":{"tablet":1024,"phone":640},"ratios":[1,1,0.7,0.5]},"controls":{"scroll":0,"touch":"0","keyboard":0},"blockrightclick":0,"lazyload":0,"lazyloadneighbor":0,"randomize":0,"type":"ssSimpleSlider","animation":["horizontal"],"animationSettings":{"duration":1500,"delay":0,"easing":"easeInOutQuint","parallax":1},"flux":[0,["bars"]],"touchanimation":"0"});
});
</script>
<div style="clear: both;"></div>
</div>
<div style="clear:both;"></div>
<header>
<div id="nav-main" class="nav-main " style="border-bottom: 2px solid rgb(237, 237, 237);">
<div class="container">
<div class="row">
<div class="col-xs-12 main-nav">
<nav class="site-navigation left" id="site-navigation">
<ul class="nav-menu clearfix" id="menu-primary">
<li class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-642 current_page_item menu-item-951" id="menu-item-951" style="padding-top: 9px; padding-bottom: 9px;"><a href="http://jillianssf.com/dev/" hidefocus="true" style="outline: medium none;">Home</a></li>
<!-- MENU ITEMS ARE HERE -->
<li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-969" id="menu-item-969" style="padding-top: 9px; padding-bottom: 9px;"><a href="http://jillianssf.com/dev/blog/" hidefocus="true" style="outline: medium none;">Blog</a></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</header>
Please let me know if you can help me with this code. 如果您可以通过此代码为我提供帮助,请告诉我。
Try adding bottom: 81px;
尝试添加
bottom: 81px;
to the .container
div. 到
.container
div。
CSS 的CSS
.nav-main .container {
background-color: rgba(0, 0, 0, 0.6) !important;
position: relative;
bottom: 81px; /* add here */
padding: 10px 0px 0px;
}
This seems to work on Firefox and Chrome (I tried using devtools). 这似乎可以在Firefox和Chrome上使用(我尝试使用devtools)。 Though the white mask (triangle thingies) on top of the nav bar would show.
尽管导航栏顶部会显示白色蒙版(三角形的东西)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.