andrejanubis Posted March 24, 2008 Share Posted March 24, 2008 Hello, lets say we have: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> <style type="text/css"> body { background: black; color:white; } a { font-size:22px; text-decoration:none; } a:link { color:blue; } a:visited { color:pink; } a:hover { color:black; background:white; font-weight: bold; } a:active { } </style></head><body><a href="http://www.w3schools.com">www.<span style="color:#ff0000">w3scho - hoverd should be black - ols</span>.com</a></body></html> I would like the link in page to be blue except the part w3schools to be redwhen mouse is over the link I would like entire link to be black on white backgroundthank you Link to comment Share on other sites More sharing options...
newseed Posted March 24, 2008 Share Posted March 24, 2008 If you want all of the link text to be block when hover, then you need to take out the inline style for the span tag. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> <style type="text/css"> body { background: black; color:white; } a { font-size:22px; text-decoration:none; } a:link { color:blue; } a:visited { color:pink; } a:hover { color:black; background:white; font-weight: bold; } a:active { } span { color: #ff0000;} span:hover { color: #000000;} </style></head><body><a href="http://www.w3schools.com">www.<span>w3scho - hoverd should be black - ols</span>.com</a></body></html> Link to comment Share on other sites More sharing options...
andrejanubis Posted March 24, 2008 Author Share Posted March 24, 2008 If you want all of the link text to be block when hover, then you need to take out the inline style for the span tag.greetings, that really works , thank you Link to comment Share on other sites More sharing options...
andrejanubis Posted March 27, 2008 Author Share Posted March 27, 2008 I would like to whole link to be black if mouse is over the part where originali is blueIf I hover over .com in the link that part link is black but in the middle is still red Link to comment Share on other sites More sharing options...
newseed Posted March 27, 2008 Share Posted March 27, 2008 The code I provided works as you requested. Maybe you made some changes that you are not aware of. Do you have a URL so I can see the results?Edit: I see what you are getting at. Try adding a class to the span tag and then change the span styles to this: span { color: #000000;} .hov {color: #ff0000;} a:hover span.hov { color: #000000;} And the html to this: <a href="http://www.w3schools.com">www.<span class="hov">w3scho - hoverd should be black - ols</span>.com</a> Link to comment Share on other sites More sharing options...
andrejanubis Posted March 27, 2008 Author Share Posted March 27, 2008 ...Do you have a URL so I can see the results?.. link for you thank you and everybody for all your help Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.