bsstweb
02-26-2008, 05:42 PM
I am working with the following code. I have the rollovers how I want them but I can't seem to bring the individual cells closer together. Does anyone know a way to accomplish this - even if my existing code has to be tweaked. I'm open to almost any suggestion except using Javascript. Thanks in advance.
My html looks like this:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>css image navigation test</title>
<link rel="stylesheet" type="text/css" media="screen" href="navtest.css" />
</head>
<body>
<div id="navigation">
<ul>
<a class="mainlink" href="#">testing link</a><br />
<a class="mainlink" href="#">testing link</a><br />
<a class="mainlink" href="#">testing link</a><br />
<a class="mainlink" href="#">testing link</a><br />
<a class="mainlink" href="#">testing link</a><br />
<a class="mainlink" href="#">testing link</a><br />
</ul>
</div>
</body>
</html>
My CSS code looks like this:
body {
background-color: #333333;
}
#navigation {
position: relative;
top: 100px;
left: 40px;
}
.testlink {
margin: -10px 0 -10px 0;
padding: 0px;
}
a.mainlink:link {
font-family: verdana;
font-size: 14px;
text-decoration: none;
color: #000066;
text-align: center;
vertical-align: middle;
height: 30px;
width: 150px;
background-color: #666666;
display: table-cell;
}
a.mainlink:hover {
font-family: verdana;
font-size: 14px;
text-decoration: none;
color: #990000;
text-align: center;
vertical-align: middle;
height: 30px;
width: 150px;
background-color: #999999;
display: table-cell;
}
My html looks like this:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>css image navigation test</title>
<link rel="stylesheet" type="text/css" media="screen" href="navtest.css" />
</head>
<body>
<div id="navigation">
<ul>
<a class="mainlink" href="#">testing link</a><br />
<a class="mainlink" href="#">testing link</a><br />
<a class="mainlink" href="#">testing link</a><br />
<a class="mainlink" href="#">testing link</a><br />
<a class="mainlink" href="#">testing link</a><br />
<a class="mainlink" href="#">testing link</a><br />
</ul>
</div>
</body>
</html>
My CSS code looks like this:
body {
background-color: #333333;
}
#navigation {
position: relative;
top: 100px;
left: 40px;
}
.testlink {
margin: -10px 0 -10px 0;
padding: 0px;
}
a.mainlink:link {
font-family: verdana;
font-size: 14px;
text-decoration: none;
color: #000066;
text-align: center;
vertical-align: middle;
height: 30px;
width: 150px;
background-color: #666666;
display: table-cell;
}
a.mainlink:hover {
font-family: verdana;
font-size: 14px;
text-decoration: none;
color: #990000;
text-align: center;
vertical-align: middle;
height: 30px;
width: 150px;
background-color: #999999;
display: table-cell;
}