views:

47

answers:

1

currently i'm having 2 issues. first of all, in chrome and safari there is a gray border around an image link. the border isn't there in firefox. here's the code:

<a href="link.html" target="_blank">Link title <img class="leaving" /></a>

and css:

.leaving {
    background-image: url("images/leaving.png");
    height:10px; width:10px;
    display:inline-block;
    background-repeat:no-repeat;
    border:none;
}

how do i get rid of the border?

also, certain heading links are being underlined in chrome and safari even though i set text-decoration to none. i would like to know how to get rid of the underline and also how to change it's color.

<a href="link">
<h3>Title</h3>
</a>

a h2,h3{
    color:#00264B;
    text-decoration:none;
}

"a" is set to underline in other places, but shouldn't "a h3" override anything else? what's going on here?

thanks.

+1  A: 

you have a possible bug in your code :)

Here's what you have so far:

a h2,h3{
    color:#00264B;
    text-decoration:none;
}

The code above say's all H2's which are contained with "a" tags, and all h3's (which are NOT contained within "a" tags)

Firstly if you want all H3's which are contained inside "a" tags, then you need to do this:

a h2, a h3{
    color:#00264B;
    text-decoration:none;
}

Notice that I've added another "a" to the CSS

Secondly, and perhaps more importantly, I think it's better form to enclose "a" tags inside "h" tags as opposed to the way you are doing it:

h2 a, h3 a{
    color:#00264B;
    text-decoration:none;
}

But that might not work with your existing code:

Hope this helps

stephenmurdoch
+1 agree with the anchor and header tagging encapsulation
Alex
hmm that fix doesn't seem to work. still seeing underlines in chrome and safari. and unfortunately, i can't enclose the a within the h3 because i'm using drupal and this is the only way i can link this particular heading.
vee
hmmm, strange. Perhaps the image border problem can be resolved by doing: `img.leaving { border: none }` - notice that I've added `img` before `.leaving`- as for the h3 problem, do you have firebug installed? If so, you can use it to see where the style for those elements is coming from - there must be a rogue statement somewhere in your code that is setting these unwanted values :)
stephenmurdoch
using firebug, it's clear to me that border is set to none/0 on the image (i tried your variation and many others). this appears to be some issue chrome and safari have with images that don't have an src declarations. i would love to find a solution to this! i think i'll start another thread just for that issue.also i'm at a complete loss about the h3 issue. the computed style in firebug clearly says "text-decoration:none". i even tried doing <div class="h3copy"></div> instead of using <h3></h3>, and there's still an underline!! what's up with chrome and safari? could this be a drupal issue?
vee