You are here: [CSS] How to combine anchor tags w/o underlining images on hover « HTML « IT news, forums, messages
[CSS] How to combine anchor tags w/o underlining images on hover

Posted by DC on 12/31/05 21:37

Given:

a {
text-decoration:none;
}

a:hover {
text-decoration:underline;
}


Case #1

<p>
<a href="http://www.conservative.ca/">
<img src="images/logo_cpc_e.png" />
Conservative Party of Canada
</a>
</p>


Case #2

<p>
<a href="http://www.conservative.ca/">
<img src="images/logo_cpc_e.png" />
</a>
<a href="http://www.conservative.ca/">
Conservative Party of Canada
</a>
</p>

* markup simplified for clarity (I'm not an idiot }:O)


PROBLEM:

Same css for both cases. In case #1 (shared anchor tag), hover causes img to
be underlined along with the link text. Ugly. However, in case #2, img not
underlined on hover.

Why?

I don't want the unnecessary bloat from duplicating anchor tags. Can I
achieve this with css? What am I doing wrong? I'm sure it is something
simple but I can't suss it.

Thanks.

--
DC Linux RU #1000111011000111001

The word 'politics' is derived from the word 'poly', meaning 'many'
and the word 'ticks', meaning 'blood sucking parasites'.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация