Click to See Complete Forum and Search --> : link styling


g2k556
04-25-2008, 07:14 PM
Hi, i've recently decided to start a web page about myself for possible employers to take a look at to get more information about me. Everything has been going really smooth, but I've come across one problem. I have a navigation area on the left side of my screen. The top and left sides are blue and the middle is white. So I would like to place links on the left, but I want their background to be a shade of gray, or something other than blue, but when I try to make it so the link is a certain width, it still ends right as the text ends, eventhough i'd like it to extend till the blue ends. here's my code for the link, i didn't include the class but i double checked that and it's correct, so i'll just leave it out:

{width: 200px;
height: 15px;
background-color: white;
color: purple;
font: 12px Georgia, "Times New Roman", Times, serif; }

i'm pretty familiar with css and whatnot, but it's been a long time since i've done any web designing, so i'm still trying to refresh my memory. I know in the past that i've gotten a similar situation to work how i want it, but i can't remember how i did it. So any help is much appreciated. Thanks in advance, Gavin.

smyhre
04-25-2008, 07:17 PM
Try putting a padding on the sides that should make it work. The sides of the link that is.

Centauri
04-25-2008, 07:23 PM
Links are inline elements, so they cannot be assigned width or height. Adding display: block; to the link's css will convert it to block display and allow sizes to be set. If you require links side by side, then float: left; should be used instead of block display.

smyhre
04-25-2008, 07:26 PM
Or if you want to go the definite width direction then you probably could use display: block; on the link for the width to work.

Figures Centauri beat me to it :)

g2k556
04-25-2008, 08:02 PM
thanks, the display block is what i was forgetting :D should be good now.

g2k556
04-25-2008, 08:58 PM
well, it worked, now i have another question, how do i disable scrolling with IE, i've got it to not scroll in ff, but it still does in IE, i used overflow hidden.

I wish there was a standard for browsers so we wouldn't have to make them fit with several different browswers :/