Getting rid off the border round link images
Hi everyone
I can't remember how to get rid of the border on images when i use them as links, and also can someone remind me the code for changing text links, sumthin link
But i can't remember it very well.
cuddlers89
Junior Poster in Training
57 posts since Mar 2004
Reputation Points: 11
Solved Threads: 0
To get rid of borders around link images add border="0" to the image.
The preferred method for changing link colours is using stylesheets. You'd use something like
a:link{text-decoration:none;color:#3366cc;font-weight:bold;}
a:visited{text-decoration:none;color:#6699ff;font-weight:bold;}
a:active{text-decoration:none;color:#3366cc;font-weight:bold;background-color:#cccc00;}
a:hover{text-decoration:none;color:#0000cc;font-weight:bold;background-color:#cccc00;}
You can use link, alink, and vlink on the body tag and it will still work in current browsers but the body tag option doesn't allow you to set the hover colour.
felgall
Junior Poster in Training
50 posts since Aug 2004
Reputation Points: 13
Solved Threads: 1
Ok thanks, i sort of understand but have never used css before, the image is the only one on the page and there isn't very many links, so if css does what i think it does, i don't think its nessasary here.
Just to be clear, i don't want to get rid of the border around an image, i have allready done that, its when i set the image to a link that the border comes up
You probley have answerd my question but i just don't understand css.
cuddlers89
Junior Poster in Training
57 posts since Mar 2004
Reputation Points: 11
Solved Threads: 0
a img{
border:none; /* or use border:0; - does the same thing here */
}
The image element is enclosed within a link tag, so ensure that this is represented in the css, otherwise all image styles will look like link images. However, if you don't want link images to look different from normal images (all images look the same regardless of whether they're links or not, just do this:
img{
border:none; /* or use border:0; - does the same thing here */
}
I'd advise you to stay clear or html attributes like border="0". HTML is for logic, CSS is for styling. Try not to mix them.
See http://www.w3schools.com/tags/tag_img.asp
It will tell you that border attributes are deprecated.
diafol
Rhod Gilbert Fan (ardav)
7,800 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080