Jump to content

image links and borders


deltahawk12
 Share

Recommended Posts

hey everyone, ive got a small issue that proboly easy to fix. Im linking my banner to my mainpage so that when you click on it; it brings you back to the main page. know that works its as easy as pie but im stuck with the css portion of it. Im trying to remove the colored border the image links leave behind. I know about pseudo-class. and how you need to use a:link and a:visited to style the links but im not sure what to use to get rid of the border around the image. any help would be great.

Link to comment
Share on other sites

hey everyone, ive got a small issue that proboly easy to fix. Im linking my banner to my mainpage so that when you click on it; it brings you back to the main page. know that works its as easy as pie but im stuck with the css portion of it. Im trying to remove the colored border the image links leave behind. I know about pseudo-class. and how you need to use a:link and a:visited to style the links but im not sure what to use to get rid of the border around the image. any help would be great.
The border="0" worked but i want to use css such that my html file is getting abit big to add that code everywhere. I tried the a:img. but it didnt work this is what i did
 a:img{border:0px;}

Whats wrong with it?

Link to comment
Share on other sites

What aspnetguy said. But using the pseudo-class you mentioned, you have power in controlling the border of that image between the link states. If you remove the border from the image when its link is in "link" state, you could still have a border for the image when link is in "hover" state. I just mean to say, you can remove the border from the image in all link states, just by this css:a img { border:0; }(syntax differes from that of above, but means the same)But you can also define only the removal of the border when in eg hover state, by this:a:hover img { border:0; }Or even only the active and visited but not the hover:a:visited img, a:active img { border:0; }a:hover img { border:solid 2px rgb(150,150,150); }You can make every difference between the states you like. :)[*Edit:]Remove the colon between the A and IMG elements, it is only needed between an element and a pseudo-class :) Leaving a space there means every IMG tag inside an A element.

Edited by Dan The Prof
Link to comment
Share on other sites

The border="0" worked but i want to use css such that my html file is getting abit big to add that code everywhere. I tried the a:img. but it didnt work this is what i did
 a:img{border:0px;}

Whats wrong with it?

I did not write "a:img" I wrote "a img"
Link to comment
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
 Share

×
×
  • Create New...