Home > Web Front-end > HTML Tutorial > The navigation bar is not displayed properly_html/css_WEB-ITnose

The navigation bar is not displayed properly_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:18:49
Original
1038 people have browsed it

I want to create a style where the navigation bar is fixed at the top. There is something wrong with the current display, as shown below:

I did not use margin-top, padding-top or the like.

<div id="top_bar">  <div id="nav">  <ul>  <li>Login</li>  <li>Register</li>  </ul>  </div></div>
Copy after login


#top_bar{top:0;left:0;right:0;height: 40px;width:100%;position:absolute;background-color: #00CCFF;}#nav{width:960px;height:40px;margin:auto;background-color:#c0c0c0;}ul{height:40px;float:right;margin-right:20px;list-style:none;background-color:#000;}li{height:40px;float:left;margin-left:20px;color:#ffffff;}
Copy after login


Reply to discussion (solution)

No, no one can solve this problem

Is this the effect? ​​

<div id="top_bar">  <div id="nav">  <ul>  <li>Login</li>  <li>Register</li>  </ul>  </div></div>
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template