Sign in to follow this  
Slaru

[web] Trouble with CSS and new site

Recommended Posts

Hello, I am writing a simple web page to show my work. I already know HTML and decided to give CSS a try. I had done one other simple page using CSS (sorta). The problem is, in my header div, I have a picture that is a link to the home page. The picture has a 'border' around it because it is a link. How can I get rid of this? My Site I have three divs, a header, a Menu, and a Contents area. I have written the CSS for the link tag as so:
a {
	color:#ccc;
	font-size:11px;
	text-decoration:none;
	font-weight:550;
	font-family:verdana, arial, helvetica, sans-serif;
	}
a:link {color:#ccc;}
a:visited {color:#c9c;}
a:hover {background-color:#0F0;}

I tried this to fix the problem with the header:
#Header > a {
	color:#ccc;
	font-size:11px;
	text-decoration:none;
	border:0px;
	border-color:transparent;
	font-weight:normal;
	font-family:verdana, arial, helvetica, sans-serif;
	}
#Header > a:link {color:#ccc;}
#Header > a:visited {color:#ccc;}
#Header > a:hover {background-color:transparent;}

This doesn't seem to be working. I am doing it right? Am I totally stupid and should stick to game programming?

Share this post


Link to post
Share on other sites
To get rid of borders around images, use this rule:

a img { border: none; }

The fix you have on the header doesn't work in IE, since IE doesn't support ">" in selectors. Just use:

#header a { ... }
#header a:hover { ... }
...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this