Hi, I have a H2 in an <a href where the text inside is underlinedon hover, but i don't want the h2 to be underliend on hover. The following is the html.. <div class="forumTopics"> <a href=""> <h2>Header i don't want underlined on hover</h2> Underlined on hover text </a> </div> HTML: This is what i've tried so far.. .forumTopics a h2:hover{ text-decoration:none; } .forumTopics h2:hover{ text-decoration:none; } a.forumTopics h2:hover{ text-decoration:none; } .forumTopics h2:hover{ text-decoration:none; } h2.forumTopics:hover{ text-decoration:none; } HTML:
First off, anchors cannot contain headings because inline elements cannot contain block level elements. Swap the order of the anchor and heading (in other words, put the link inside the heading) and then adjust your CSS accordingly.