Jump to content

Css Color Property Won't Change


DextrousDave

Recommended Posts

Hi.I am building my website with ASP.NET-C#. Now I have used a CSS Class to define the lookof my navigation bar. Now my problem is that the font color won't change, it stays purple, doesn'tmatter what color I change it to. I am using # infront of the color. Weird thing is I don't have anyproblems with the a:hover element, only with the static default color. How can I fix this?My CSS stylesheet:a:hover{ font-family: 'Viner Hand ITC'; font-size: large; font-weight: bold; color: #808080; background-color: #008000; background-image: url('../images/tab.jpg');}.menuPanel{ font-family: Verdana; font-size: large; font-weight: bold; color: #008000; border-style: none; position: fixed; margin-left: 250px; margin-right: 250px; text-decoration: none;} Thanks!

Link to comment
Share on other sites

By default browsers have default colours for visited, link, hover, and active state links. If you set the colour of text for just hover state, that will change but the remainder will still use default colours set by browser. To fix, you would have to set the default styling yourself a {font-family: 'Viner Hand ITC';font-size: large;font-weight: bold;color: #808080;background-color: #008000;background-image: url('../images/tab.jpg');} for hover, visited etc you only add the styling that would change, for example, and this should come after the default styling set above and in order of LoVe HAte Link, Visited, Hover, Active. a:link {color: blue; text-decoration:none;} a:visited { color: red; text-decoration:none; } a:hover { color: lime; text-decoration:underline; } a:active { color: yellow; text-decoration:none; } /* not reliable, different browsers produce different results*/

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...