Jump to content

Trying to get the NavBar into center of the image


Leon

Recommended Posts

Hi im new to css. Im trying to get the nav bar into the center of the header image. For some reason im following the tutorial online step by step and still doesnt work.

 

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Nav Bar and Header</title>
<link rel="stylesheet" type="text/css" href="navbar.css"/>
</head>
<body>
<div id="nav">
<div id="nav_wrapper"> <br>
<ul>
<li><a href="#">Home Menu</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</body>
</html>
This is my code。
if code was written :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Nav Bar and Header</title>
<link rel="stylesheet" type="text/css" href="navbar.css"/>
</head>
<body>
<div id="nav">
<li><a href="#">Home Menu</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
<div id="nav_wrapper"> <br>
<ul>
<li><a href="#">Home Menu</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</body>
</html>
it will happen image one. Is there a way to move the

 

post-190011-0-86047400-1463880659_thumb.jpg

post-190011-0-41447800-1463880660_thumb.jpg

post-190011-0-89886700-1463880660_thumb.jpg

Link to comment
Share on other sites

Its not a tutorial on 'how to set navigation to centre of header', it is tutorial on 'how to create transparent navigation bar HTML & CSS'. If you mean vertically centre? it is not vertically centre, it just uses margin along top edge to bring it down from the top. The LI elements must be within UL elements, and for current effect must be placed within 'nav_wrapper' element, also you will need to widen this element to take the extra LI elements placed within it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...