otester Posted August 10, 2010 Share Posted August 10, 2010 I wanted to make my header text into a link (so a user can get back to the main page easily). I've noticed that H1 tags don't behave the same way as normal div tags when it comes to dealing with links. The H1 link just won't respond (stays default blue link colour): HTML: <div id="header_container_menu_item_2"><a href="http://www.punch101.com"><h1 id="title_link">x</h1></a></div> CSS: a.title_link:link { text-decoration: none; color: #F90; } a.title_link:visited { text-decoration: none; color: #F90; } a.title_link:hover { text-decoration: none; color: #F90; } a.title_link:active { text-decoration: none; color: #F90; } Any help at all would be greatly appreciated? Link to comment https://forums.phpfreaks.com/topic/210373-changing-link-colour-of-h1-tag/ Share on other sites More sharing options...
lostprophetpunk Posted August 10, 2010 Share Posted August 10, 2010 Take the 'id="link_title"' from the <h1> tag and pop it in the <a href="#"> tag, so it looks like this... <div id="header_container_menu_item_2"><a href="http://www.punch101.com" class="title_link"><h1>x</h1></a></div> Link to comment https://forums.phpfreaks.com/topic/210373-changing-link-colour-of-h1-tag/#findComment-1097784 Share on other sites More sharing options...
otester Posted August 10, 2010 Author Share Posted August 10, 2010 Take the 'id="link_title"' from the <h1> tag and pop it in the <a href="#"> tag, so it looks like this... <div id="header_container_menu_item_2"><a href="http://www.punch101.com" class="title_link"><h1>x</h1></a></div> Works a treat, thanks a lot! Link to comment https://forums.phpfreaks.com/topic/210373-changing-link-colour-of-h1-tag/#findComment-1097786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.