views:

90

answers:

2

I have a site where the page is formatted to be 800px wide with an image taking up the top 40 pixels. I wrapped the image with an anchor tag so that clicking on the image takes user to home page. When I wrap the image with an anchor tag, the image seems to shift to the right a little bit which throws of the alignment!

Is there a way I can clear absolutely all formatting from an anchor tag?

+2  A: 

Must be the classic image border issue that adds a visible border to your image if it's a hyperlink. Try this (if you wish, edit the a img part to only target your header or the image ID or something):

a img {
    border: 0;
}
BoltClock
A: 

David is right in his comment; Every style for the anchor tag (border, margin, color, :visited, etc) has to be individually undone. BoltClock's suggestion is sufficient for me, but for anyone else who truly does want to reset any tag, try looking at Yahoo's reset CSS (http://developer.yahoo.com/yui/3/cssreset/).

Thr4wn
The point of a reset CSS is to reset the *browser's* default CSS, not your own. So if you style a link and then apply the YUI reset CSS, it's probably not going to undo most of your changes.
Josh Leitzel
True. I assumed before that YUI's reset CSS would have an individual one for the anchor tag that I could copy from. But I looked at it and now see that using that CSS would indeed wipe everything in one fell swoop.
Thr4wn