Adding Space

He has: 578 posts

Joined: Jun 2004

On my menu at freewebs.com/bacsikdesigns/index.html

I have the following css code:
A.menu1 {
text-decoration:none;
font-weight:bold;
background-color:#008FFF;
font-family: verdana, arial, geneva;
color:#FFFFFF;
border-left:2px dotted #FF6A00;
border-right:2px dotted #FF6A00;
padding-left:8px;
padding-right:8px;
margin-top:0px;
margin-left:0px;
margin-bottom:0px;
margin-right:0px;
}
A.menu1:hover {
text-decoration:none;
font-weight:bold;
background-color:#FF6A00;
font-family: verdana, arial, geneva;
color:#FFFFFF;
border-left:2px dotted #FF6A00;
border-right:2px dotted #FF6A00;
padding-left:8px;
padding-right:8px;
margin-top:0px;
margin-left:0px;
margin-bottom:0px;
margin-right:0px;
}
A.menu {
text-decoration:none;
font-weight:bold;
background-color:#008FFF;
font-family: verdana, arial, geneva;
color:#FFFFFF;
border-right:2px dotted #FF6A00;
padding-left:8px;
padding-right:8px;
margin-top:0px;
margin-left:0px;
margin-bottom:0px;
margin-right:0px;
}
A.menu:hover {
text-decoration:none;
font-weight:bold;
background-color:#FF6A00;
font-family: verdana, arial, geneva;
color:#FFFFFF;
border-right:2px dotted #FF6A00;
padding-left:8px;
padding-right:8px;
margin-top:0px;
margin-left:0px;
margin-bottom:0px;
margin-right:0px;
}

I have tried changing the padding to zero, C+P ing menu1 and then just changing to just a right border, and I can't figure out why there is a space between the orange higlight and the border. It doesn't do that with menu1. I don't know why it does this, or why it doesn't in menu1.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Try putting your s on one line.

He has: 578 posts

Joined: Jun 2004

Bah, I never think of the obvious things! Thanks.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

It's not really an obvious thing. I don't know the reason for browsers to behave like that, actually. I like to keep code readable -- I wish there was a better way. Sad

He has: 578 posts

Joined: Jun 2004

Now that I have that problem fixed, I have space on the bottom that doesn't get highlighted. I've tried adding padding-top and padding-bottom, and setting them to zero, but that doesn't do anything.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Update sample page?

He has: 578 posts

Joined: Jun 2004

He has: 578 posts

Joined: Jun 2004

Boy, just fixed the problem. I set the div to 1.2 em. That made it just tall enough to look good, and fit the text in. Plus, the hover stretches all the way down.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.