I've started redesigning a page using CSS, but I've come up with a but of a problem. I'm trying to make nice CSS rollover buttons. I tried a script from a website which used an unordered list, but it caused problems with Opera, plus it wouldn't let me space the buttons equal distance apart.
I decided to just use a class on the buttons, but no matter what I do, it won't let me put any space between them, not with spacer gifs, non breaking spaces, nothing.
Any insite into this would be much appreciated, I'm about ready to say stuff it and put the buttons in tables!
website
css file
----------------------------------------
Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
I decided to just use a class on the buttons, but no matter what I do, it won't let me put any space between them, not with spacer gifs, non breaking spaces, nothing.
Any insite into this would be much appreciated, I'm about ready to say stuff it and put the buttons in tables!
website
Code:
<div class="box">
<img src="images/Motel.gif" width="155" height="91" class="imagespace">
<img src="images/Motel_Title.gif" width="296" height="72" class="imagespace">
<img src="images/qualmark_3star.gif" class="imagespace">
<img src="images/MANZ.gif" class="imagespace">
<br>
<div class="menu-box">
<a class="nav" href="#">Home</a>
<a class="nav" href="#">Book Online</a>
<a class="nav" href="#">Location</a>
<a class="nav" href="#">Local Attractions</a>
</div>
<br>
<br>
<br></div>
css file
Code:
body, P, H1, H2, H3, H4, H5, H6, TD, DIV, OL, UL, DL {
font-family: Arial, Helvetica, sans-serif;
color: #000000;
background-color: #FFCC00;
text-align: center; /* catering for IE5.5 and older */
}
.box {
text-align: left; /* so that text is not centered anymore */
background-color: #FFFFFF;
border: 1px solid #000000;
width: 760px;
height: 100%;
position: static;
margin: 0 auto; /* meaning top and bottom margins are 0, left and right are auto, which centers the box in standard browsers */
}
.imagespace {
padding: 10px 20px 2px 10px;
position: static;
}
.menu-box {
text-align: center;
background-color: #FFFFFF;
border: 1px solid #000000;
width: 720px;
height: 24px;
position: static;
margin: 0 auto;
display: block;
vertical-align: middle;
padding: 2px 10px;
}
.imagespace2 {
position: static;
padding: 10px 10px 3px 20px;
}
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
/* End hide from IE-mac */
.nav {
padding: 2px;
height: 17px;
width: 112px;
border: 1px solid #000000;
}
a.nav:link {
background: #FFCC00;
height: 2em;
line-height: 2em;
float: left;
width: 112px;
display: block;
border: 1px solid #000000;
color: #000000;
text-decoration: none;
text-align: center;
font-size: 11px;
font-weight: bold;
margin: 0;
padding: 0;
}
a.nav:visited {
background: #FFFFCC;
height: 2em;
line-height: 2em;
float: left;
width: 112px;
display: block;
border: 1px solid #000000;
color: #000000;
text-decoration: none;
text-align: center;
font-size: 11px;
font-weight: bold;
margin: 0;
padding: 0;
}
a.nav:hover {
background: #6699FF;
height: 2em;
line-height: 2em;
float: left;
width: 112px;
display: block;
border: 1px solid #000000;
color: #000000;
text-decoration: none;
text-align: center;
font-size: 11px;
font-weight: bold;
margin: 0;
padding: 0;
}
a.nav:active {
background: #FFFFFF;
height: 2em;
line-height: 2em;
float: left;
width: 112px;
display: block;
border: 1px solid #000000;
color: #000000;
text-decoration: none;
text-align: center;
font-size: 11px;
font-weight: bold;
margin: 0;
padding: 0;
}
.main a:link {
color: #000000;
text-decoration: none;
}/*normal links in the text*/
.main a:visited {
color: #000000;
text-decoration: none;
}
.main a:hover {
color: #000000;
text-decoration: underline;
}
.main a:active {
color: #000000;
text-decoration: underline;
}
----------------------------------------
Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..