...

View Full Version : Padding Navbar Issues



gabriel515
04-23-2011, 09:06 AM
I am trying to make a navbar for a website, it is a div I have added 'padding: 4px;' to make the text sit better but it seems to be a bit larger than one I did earlier... Any suggestions???

Earlier Site(Different site entirely):
http://i54.tinypic.com/289k6kj.png

CSS For Above Pic:

div.navbar {
border: 1px solid black;
padding: 4px;
text-align: center;
background: #b2beb5;
width: 900px;
margin: 0 auto;
}

Site I am Building:
http://i55.tinypic.com/25rmm3a.png

CSS For Above Pic:

div.navbar {
text-align: left;
background: #ffffff;
width: 900px;
padding: 4px;
margin: 0 auto;
}

abduraooft
04-23-2011, 09:33 AM
Please post your complete code or a link to your page.

gabriel515
04-23-2011, 09:36 AM
Here is the HTML for the site i am trying to build which needs solved:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<img class="img1" src="photos/banner.png"/>
<div class="navbar">
<p><a href="index.html">Home</a></p>
</div>
</body>
</html>

abduraooft
04-23-2011, 10:29 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Your current DOCTYPE (http://www.alistapart.com/articles/doctype/) is incomplete. Use a Strict one instead.

After that, add
*{
margin:0;
padding:0;
} into your CSS to remove all browser specific defaults of margins and paddings from all elements.

gabriel515
04-23-2011, 10:50 AM
Didn't work I want the 2nd navbar to be the same as the 1st?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum