Home   News  Product reviews  Website reviews  Forums   Competitions  Subscribe 


Web Building >> Web design & build
 |  Print Topic
Jump to first unread post. Pages: 1
mw1
regular


Reg'd: Wed
Posts: 388
CSS Properties
      #67774 - Fri May 14 2004 12:03 AM

I am trying to get my head around the attributes of the CSS selector a:hover ??
can this selector have more than one attribute assign to the colour of the text that it changes to when the cursor hovers over a link ??
I am looking at the homepage of web-user, and I thought that all the links when hovered over turned red. I presumed that therefore the attribute for the hover selector when hovered over must be set to change the text to red..
Why is it then that when you hover over reversed out type ( white type ) it changes to yellow ???
how can a selector therefore have more than one attribute set for the colour of type..
hope this makes sense.. as I am a complete novice to this HTML malarkey I am probably missing the obvious..( I hope )
hope someone can explain it in laymans terms
Thanks
M
XP Pro - Intel Celeron 1400MHz - 512MB of RAM - 40 GB HDD - Freeserve BB IE6+OE6.


Post Extras: Print Post   Remind Me!   Notify Moderator  
TheFatControlleRAdministrator
Forum Admin


Reg'd: Fri
Posts: 6554
Loc: Megatripolis
Re: CSS Properties [Re: mw1]
      #67788 - Fri May 14 2004 03:54 AM

That CSS function usually comes in a set. See below for a sampler.

.headnav = the ordinary state for when the text is not a link.
.headnav a = the state for when the text is a link
.headnav a:hover = the state for when the text is a link and the cursor passes over it

.headnav {
background-color : #0052ac;
color : #c7ddf8;
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 12px;
font-weight : bold;
text-decoration : none;
}
.headnav a{
background-color : #0052ac;
color : yellow;
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 12px;
font-weight : bold;
text-decoration : none;
}
.headnav a:hover{
background-color : #0052ac;
color : #ff8c00;
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 12px;
font-weight : bold;
text-decoration : none;
}


Here's how it looks.
TFC
Nothing is a problem for me...


Post Extras: Print Post   Remind Me!   Notify Moderator  
mw1
regular


Reg'd: Wed
Posts: 388
Re: CSS Properties [Re: TheFatControlleR]
      #67805 - Fri May 14 2004 09:08 AM

Hi TFC,
fanx for your sampler...
does explain why you can have more than 1 colour for a hover selector...
easy, if you know the right method .....
cheers
M
XP Pro - Intel Celeron 1400MHz - 512MB of RAM - 40 GB HDD - Freeserve BB IE6+OE6.


Post Extras: Print Post   Remind Me!   Notify Moderator  
longplay
regular


Reg'd: Mon
Posts: 266
Loc: UK
Re: CSS Properties [Re: mw1]
      #67929 - Fri May 14 2004 03:02 PM

AS TFC points out, you can assign different text and link colours to different areas of the page. All you need to do is put them in a div with an ID attribute, so you reference it.

So

#navbar a {
color: black;
}

#content a {
color: white;
}

a {
color: purple;
}

don't interfere with each other, any link which is contained within <div id="navbar"></div> tags is black, any links between <div id="content"></div> tags are white and any other links are purple.
The Digerati Peninsula


Post Extras: Print Post   Remind Me!   Notify Moderator  
mw1
regular


Reg'd: Wed
Posts: 388
Re: CSS Properties [Re: longplay]
      #68066 - Fri May 14 2004 09:19 PM

cheers Longplay,
I'll have a play with your code ( if you don't mind )
cheers
M
XP Pro - Intel Celeron 1400MHz - 512MB of RAM - 40 GB HDD - Freeserve BB IE6+OE6.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1

Rate this topic

Jump to


Extra information
0 registered and 11 anonymous users are browsing this forum.

Moderator:  putasolutions, Joe_London, greysts, bricat, Nanook, Hello_There, John_McKenna, Mouse, TheFatControlleR 


Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      Mark-up is enabled

Rating:
Topic views: 152

Contact Us | Privacy statement Main website