jasonc Posted July 21, 2010 Share Posted July 21, 2010 /* the next few line are not to be altered, that work fine for the rest of my site. */ a:link { color:#000; text-decoration:none; } a:visited { color:#000; text-decoration:none; } a:hover{ color:#666; text-decoration: underline; } h6 {font-size: 12px; font-weight: bold; } /* the next line is what i can not get right */ #contactlink{ color:#666; font-size: 12px; font-weight: bold; } <!-- this next line is ok and shows how it should a ligh grey color --> <h6>Mobile</h6> <!-- i wish to have the hyperlink the same as above --> <div id="contactlink"><a href="contact-us.html">Contact us</a></div> what happens is the link has an underline when i hover and it is smaller in size that the top text 'Mobile' i wish to have just these two line shown the same size and color. can anyone suggest how i do this Link to comment https://forums.phpfreaks.com/topic/208400-i-am-doing-my-nut-here-can-not-figure-out-hyperlink-css/ Share on other sites More sharing options...
isedeasy Posted July 21, 2010 Share Posted July 21, 2010 Try... /* the next few line are not to be altered, that work fine for the rest of my site. */ a:link { color:#000; text-decoration:none; } a:hover{ color:#666; text-decoration: underline; } a:visited { color:#000; text-decoration:none; } h6 {font-size: 12px; font-weight: bold; } /* the next line is what i can not get right */ #contactlink a { color:#666; font-size: 12px; font-weight: bold; } #contactlink a:hover { text-decoration:none; } If I could see a live example it would be a lot easier with the help of firebug Link to comment https://forums.phpfreaks.com/topic/208400-i-am-doing-my-nut-here-can-not-figure-out-hyperlink-css/#findComment-1089029 Share on other sites More sharing options...
jasonc Posted July 21, 2010 Author Share Posted July 21, 2010 SOLVED... <a href="contact-us.html"><div id="contactlink">Contact us</div></a> seems to do the trick Link to comment https://forums.phpfreaks.com/topic/208400-i-am-doing-my-nut-here-can-not-figure-out-hyperlink-css/#findComment-1089060 Share on other sites More sharing options...
isedeasy Posted July 21, 2010 Share Posted July 21, 2010 Except that you have now put a block level element inside of an in-line element. Did you try what I suggested? You probably don't even need the div:- <a href="contact-us.html" id="contactlink">Contact us</a> Link to comment https://forums.phpfreaks.com/topic/208400-i-am-doing-my-nut-here-can-not-figure-out-hyperlink-css/#findComment-1089079 Share on other sites More sharing options...
haku Posted July 21, 2010 Share Posted July 21, 2010 Divs in anchors = bad. Link to comment https://forums.phpfreaks.com/topic/208400-i-am-doing-my-nut-here-can-not-figure-out-hyperlink-css/#findComment-1089093 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.