I have used php to randomize banners that are going to be advertised on my site. the images have a purple border around them, but i never used a tag to put a border there. To see it go to www.toon-workshop.scott-brown.net (this is a temporary domain)
You may have to refresh the page to see the image with the border. How do i get rid of it?
Image Border
Started by Hip Hop Artist, Dec 26 2006 04:42 PM
6 replies to this topic
#1
Posted 26 December 2006 - 04:42 PM
#2
Posted 26 December 2006 - 04:47 PM
That's an easy fix. What's happening is a border is getting added because the banner is being hyperlinked to a website.
To fix it, just set the border="0" or since you are using a CSS file, just add this to it:
edit: put it in a code box
To fix it, just set the border="0" or since you are using a CSS file, just add this to it:
a img { border:0px; }
edit: put it in a code box
Edited by bay, 26 December 2006 - 04:48 PM.
#3
Posted 26 December 2006 - 06:06 PM
alright thank you. It worked perfectly
#4
Posted 26 December 2006 - 06:19 PM
i dont think it needs the "a" before the "img"... but its a small thing
#5
Posted 26 December 2006 - 07:00 PM
i usually just create the class .img {border:0} and apply it to any images i dont want borders on.. depending on encoding to validate u have to use css as opposed to the old border="0"
#6
Posted 27 December 2006 - 12:59 PM
It's easiest to use the "a img" selector as it will only apply the 0 border property to linked images. It saves bandwidth because you don't have to go around adding classes to all of your linked images (assuming you have multiple images). You also don't have to worry about possible complications when redefining what images do have borders.
i.e.
p.s. Moved to proper category.
i.e.
img { boder: 1px solid black; }
/* As of this point in the code, all images have a border */
img { border:0; }
/* Now, no image has a border. Adding an "a" before "img" will fix that no matter which way you're going */
p.s. Moved to proper category.
#7
Posted 27 December 2006 - 01:02 PM
rc69, on Dec 27 2006, 05:59 PM, said:
It's easiest to use the "a img" selector as it will only apply the 0 border property to linked images. It saves bandwidth because you don't have to go around adding classes to all of your linked images (assuming you have multiple images). You also don't have to worry about possible complications when redefining what images do have borders.
i.e.
p.s. Moved to proper category.
i.e.
img { border: 1px solid black; }
/* As of this point in the code, all images have a border */
img { border:0; }
/* Now, no image has a border. Adding an "a" before "img" will fix that no matter which way you're going */
p.s. Moved to proper category.
that makes sense... shall use that in future, tho my sites are tiny and my hosting package is pretty big so at the minute bandwidth isn't really an issue just now
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
