本文介绍了导航栏未显示在网页上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不知道我的导航是在哪里。当我打开使用google chrome或IE的网页没有导航栏。为什么是这个,我需要修复什么?
I'm not sure where my navigation is. when i open using google chrome or IE the webpage has no navigation bar. Why is this and what do i need to fix?
html
<header class= 'main-header' >
<div class="logo">
!# insert logo picture
</div>
<div id="nav">
<ul id="nav">
<li><a href="/home/">Home</a></li>
<li><a href="/about/">About Us</a></li>
<li><a href="/news/">News & Events</a></li>
<li><a href="/classes/">Classes & Camps</a></li>
<li><a href="/gallery/">Gallery</a></li>
<li><a href="/contact/">Contact us</a></li>
<li><a href="/enrol/">Enrol Now</a></li>
</ul>
</div>
</header>
css
#content {
width: 50em;
margin: 0 auto;
padding: 40px 0;
}
ul#nav {
position: relative;
list-style: none;
margin: 0;
padding: 0;
}
ul#nav li {
position: relative;
float: left;
display: inline-block;
padding: 8px 5px 3px 5px;
background-color: #FFF;
text-decoration: none;
padding: .2em 1em;
}
任何想法?
注意:我试图将导航器放在我的网页的顶部。
any ideas?Note: im trying to place the navigator at the top of my webpage.Also I have placed it on a header, could it simply be beneath it?
.main-header {
overflow: hidden;
left: 0;
height:150px;
width: 100%;
background-color: black;
padding: 0px;
margin-left: 0px;
position: absolute;
top: -50px;
}
推荐答案
顶部:-50px
并添加此
html, body{
margin:0;
padding:0;
}
,您的标题应从左上角开始
and your header should start on the top-left corner of the side
这篇关于导航栏未显示在网页上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!