Hi all
This is a really simple question, I’m trying to learn CSS again and I’ve forgotten everything.
I have a basic vertical list navigation.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Test</title>
<style type="text/css">
#nav{
margin:0;
padding:0;
margin:50px 0 0 100px;
list-style-type:none;
}
#nav li{
display:inline;
}
#nav a{
display:block;
width:7em;
background:#036;
color:white;
padding:.5em .2em;
border-bottom:1px solid #fff;
text-decoration:none;
font-family:Verdana, sans-serif;
//font-size:.5em;// changing the font size changes the box size
padding-left:.5em;
}
#nav a:hover{
background:#69c;
color:#000;
}
</style>
</head>
<body>
<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">People</a></li>
<li><a href="#">Work</a></li>
<li><a href="#">Places</a></li>
<li><a href="#">Contact</a></li>
</ul>
</body>
</html>
If I don’t change the font size the buttons are this size
If I change the font size it effects the size of the buttons to this size
I know this is very basic but how can I change the font size without changing the button size, or should I set the font size then adjust the surround box to the size I want. Can anyone explain why this happens
Thanks in advance for any help.