Web Hosting Talk







View Full Version : CSS Problem (Visited Links & Mouseover)


Xiteer
05-22-2004, 12:18 AM
Hey guys.. I'm having a problem. What I'm trying to do is get my links to bold on mouseover then just go back to normal on mouseout.. this is the only change that I want to make. All links should behave the same way.

Whats happening is that visited links aren't bolding on mouseover for some reason, I've had this problem once in the past but can't remember how I fixed it... hopefully someone can help me out. Below is my code.


P {
font-size : 11px;
font-family : Tahoma;
color : #ffffff;
text-align : left;
margin : ;
}

H3 {
font-family : Tahoma;
color : #ffffff;
text-align : left;
}

H2 {
font-family : Tahoma;
color : #ffffff;
text-align : left;
}

H1 {
font-family : Tahoma;
color : #ffffff;
text-align : left;
}

BODY {
font-size : 11px;
font-family : Tahoma;
color : #ffffff;
background : #000000 url() fixed repeat;
}

BLOCKQUOTE {
font-size : 11px;
font-family : Tahoma;
color : #ffffff;
text-align : left;
}

A:hover {
font-weight : bold;
font-size : 11px;
font-family : Tahoma;
color : #ffffff;
background : normal;
}

A:link {
font-weight : normal;
font-size : 11px;
font-family : Tahoma;
color : #ffffff;
text-decoration : normal;
}

A:visited {
font-weight : normal;
font-size : 11px;
font-family : Tahoma;
color : #ffffff;
text-decoration : normal;
}


body {scrollbar-face-color: #000000;
scrollbar-highlight-color:#FFFFFF;
scrollbar-shadow-color: #FFFFFF;
scrollbar-3dlight-color:#000000;
scrollbar-arrow-color: #FFFFFF;
scrollbar-track-color: #000000;
scrollbar-darkshadow-color: #FFFFFF}


Thanks a lot!!

Xiteer

Burhan
05-22-2004, 04:07 AM
Your a:visited css will take precedence over your a:hover. If you remove that style block, it should work.

You also didn't mention what browser you were testing on.

intername
05-22-2004, 08:29 AM
Don't remove the A:visited block, just put it before the A:hover block.

Xiteer
05-22-2004, 12:07 PM
I was using IE 6.

I changed the order and it works great.. I never even knew that the order of things in CSS docs effected anything.

Thanks a lot!
Xiteer

Burhan
05-23-2004, 03:01 AM
There is an order in which CSS styles are applied (they aren't called "cascading" for nothing).

There is also priority given to css styles. Inline styles, like <p style="color:red;"> are given the highest priority, next come the styles that are placed in <style> block, and finally are style sheet files that are imported via <link> or the @import rule.