Be a Supporter!

simple "a:hover" style script?

  • 1,017 Views
  • 3 Replies
New Topic Respond to this Topic
RichL
RichL
  • Member since: Apr. 2, 2000
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
simple "a:hover" style script? 2001-07-09 16:59:43 Reply

Im trying to make different links turn (on mouseover) different colours..i know this is incredibly easy for most people but im not used to CSS! Is there a style=" tag i can put in the <font colour"red"> tag?

E.g. <font colour="red" style="a:hover: color:black">
I can figure it out. please help ;)

Freakapotimus
Freakapotimus
  • Member since: Jun. 22, 2000
  • Offline.
Forum Stats
Member
Level 19
Blank Slate
Response to simple "a:hover" style script? 2001-07-10 10:00:20 Reply

What I use is an external style sheet, so I can keep the same styles for each page, but this can easily be modified for inline style sheets, which I assume is what you are looking for. Although you might want to use an external style sheet with classes, since the FONT tag is becoming increasingly depreciated.

Here is an example from my CSS for my website. I changed the font set for the page in the BODY tag, then used the the rest to control the color and style of links.

body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; color: #FFFFFF}

a:visited { color: #FF9900; text-decoration: underline}

a:link { color: #FF9900; text-decoration: underline}

a:hover { color: #000000; text-decoration: none; background-color: #FF9900}

A good resource I use for style sheets is http://www.webmonkey.com and the HTML 4 for Dummies Quick Reference book.

Hope this helps!


Quote of the day: @Nysssa "What is the word I want to use here?" @freakapotimus "Taint".

hwnd
hwnd
  • Member since: Jan. 31, 2001
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to simple "a:hover" style script? 2001-07-12 13:19:50 Reply

put this on a tag (font, a, div, span etc)

style="color:#ff0000;" onMouseover="style.color='#00ff00';" onMouseout="style.color='#ff0000';"

DeleteThisAccountNow
DeleteThisAccountNow
  • Member since: Aug. 17, 2000
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to simple "a:hover" style script? 2001-07-13 18:05:38 Reply

At 7/10/01 10:00 AM, Freakapotimus wrote: What I use is an external style sheet, so I can keep the same styles for each page, but this can easily be modified for inline style sheets, which I assume is what you are looking for. Although you might want to use an external style sheet with classes, since the FONT tag is becoming increasingly depreciated.

First of all I did not know you could make a seperate external style sheet and have them applied to all pages. I am also new to CSS so don't feel bad.

Here's something I ripped from my page... Hopefully you'll understand what it means.

- = < or >


-style type="text/css"-
body,p,td {font-family:verdana,arial; color: #FFFFFF; font-size:9px;
scrollbar-face-color:#087EA4; scrollbar-shadow-color:#006586; scrollbar-highlight-color:#1B91B7; scrollbar-3dlight-color:#004E68; scrollbar-darkshadow-color:#087EA4; scrollbar-track-color:#000000; scrollbar-arrow-color:#087EA4; }
a:link {text-decoration:none; color: #2CC8FB; }
a:active {text-decoration:none; color: #FFFFFF; }
a:visited {text-decoration:none; color: #1C8F9C; }
a:hover {text-decoration: none; color: #FFFFFF; }
-/style-