tags:

views:

211

answers:

7

For some reason I have a very ugly orange part of a border around a image.

Can anyone see why this is?

This is the HTML

<div class="preview">

            <a href="images/foto/full/280899624_6_5_j6.jpeg" title="Sportschool Raymond Snel" rel="lightbox"><img src="images/foto/full/280899624_6_5_j6.jpeg" alt="text" /></a>

</div>

This is the css

.preview {
    width: 85px; 
    height: 85px; 
    overflow: hidden;
    border: 3px solid #2e2a26;
    }

The color code = FF6a00 but appears only one time in the css file.

a {
    color: #ff6a00;
    text-decoration: none;
    border: 0px;
}

As you can see I already gave it a 0px, but for some reason the border is still there.

+3  A: 

Try img { border: 0; }

Xr
This is the best option IMO, because now borders will only appear when you explicitly specify them.
DisgruntledGoat
Indeed. That's why it's one of the first things I write when I start a new stylesheet.
Xr
+1  A: 

Try the following CSS it will make sure any image inside a link doesn't get a border.

a img { border:0px;}
Jeff Beck
+1  A: 

You'll want to remove the border on images instead of just on the anchor. The border is actually coming from images inside anchors so the following will fix it:

img{border:none;}
Jamie Dixon
+1  A: 

Try this:

.preview a img { border: 0px; }
Nick Craver
Probably the best option in the mix as it only relates to links inside your .preview div
Jeff Beck
+1  A: 

The border is because the image is a link (think about how links are blue by default - the same applies to image links, they have a border by default).

This line will fix it

.preview a img {border: 0;}
slightlymore
any particular reason for the -1 from whoever it was? To make your answer appear higher in the list?! If you're going to -1 at least leave a reason why you did it :/
slightlymore
A: 

Just try and put border="0" inside img tag. Let me know if that helps.

Pratik Talati
+1  A: 

Try this:

.preview a:link img, .preview a:active img, .preview a:hover img, .preview a:selected img, .preview a:visited img{border-style:none;}
Jon
You forgot `a:visited`. But ... why not just `.preview a img` ?
BalusC
That was my original thought, but the other night I had an issue where I did something similar, using a img to take off the border, but once I selected it the border came back. It was pretty strange, but I figured I'd offer this as an alternative in case Chris has the same problem. Also, I added in visited. Thanks for the catch!
Jon
great, it's a good way to do this. In my case I forget to post a part of css which was a container for all the links with border properties. For the future your sollutions is great!
Chris