DextrousDave Posted September 10, 2011 Share Posted September 10, 2011 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 More sharing options...
Drycodez Posted September 10, 2011 Share Posted September 10, 2011 You need to set a:visited . Link to comment Share on other sites More sharing options...
dsonesuk Posted September 10, 2011 Share Posted September 10, 2011 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 More sharing options...
DextrousDave Posted September 10, 2011 Author Share Posted September 10, 2011 Think I solved it, but not sure if it is the right way:I added an extra 'a' element like so:a{ text-decoration: none; color: #FFFFFF;}Color FFFFFF is the one I want and the text decoration took away the lousy underlining that I also couldn't get rid of Link to comment Share on other sites More sharing options...
DextrousDave Posted September 10, 2011 Author Share Posted September 10, 2011 Oh thanks this helps a lot, appreciate Guys! Link to comment Share on other sites More sharing options...
DextrousDave Posted September 10, 2011 Author Share Posted September 10, 2011 @dsonesuk-Thanks, exactly the answer I was looking for Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.