So I'm using an unordered list to create a horizontal navigation bar and I want to center that toolbar. However, there's a small space at the start of the toolbar that is causing it to be slightly off center when I use text-align:center. Here's a pic of it not centered:
I would like to get "Home" right up against the left most border. But there seems to be about 20px space. Here is a pic of the nav bar centered:
I feel like its off center because the 'Home' button is slightly off center with "Tristan Gianola." Here is the CSS & HTML:
nav{font-family: 'Roboto Condensed', sans-serif;
font-size:14px;
text-transform:uppercase;
margin:0;
padding:0;
margin-top:50px;
border:solid 5px red;
text-align:center;}
nav ul{border:solid 5px green;}
nav ul li{display:inline;
margin:2px;}
nav ul li strong{text-decoration:none;
color:#003434;
background:#f2f2f2;
padding:10px;}
nav ul li a{text-decoration:none;
color:#f2f2f2;
background:#003434;
padding:10px;
border-bottom:solid 1px white;}
nav ul li a:hover{background:grey;}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link href='http://ift.tt/1bSiS9T' rel='stylesheet' type='text/css'>
</head>
<body>
<!--site navigation / toolbar-->
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="media.html">Media</a></li>
<li><a href="calendar.html">Calendar</a></li>
<li><a href="projects.html">Projects</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
<h1>Tristan Gianola</h1>
</body>
</html>
Thanks so much for reading/answering in advance.
Aucun commentaire:
Enregistrer un commentaire