Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > onmouseover effects for body text

Reply
Thread Tools

onmouseover effects for body text

 
 
some dude somewhere
Guest
Posts: n/a
 
      10-17-2003
Hi there,

I know how to make hyperlinks different with all kinds of text decorations.
But is there also a way to change the color of your text (plain body text,
NO hyperlinks)?

So when your mouse hovers over a textfield (tabel), the font color will
change?

Thanks for any advice or help,

Eric


 
Reply With Quote
 
 
 
 
Toby A Inkster
Guest
Posts: n/a
 
      10-17-2003
some dude somewhere wrote:

> But is there also a way to change the color of your text (plain body text,
> NO hyperlinks)?


The neat way to do this is to use CSS. In your style sheet, put say:

..magic:hover {
background-color: #004;
color: #FFC;
}

and then in your HTML:

<p>Here is a paragraph with some <span class="magic">magic text</span>.</p>

However, this doesn't work in Internet Explorer (only in Netscape>6 and
Opera>7). If you want IE support, do the same as above but then add some
JavaScript events:

<p>Here is a paragraph with some <span class="magic"
onmouseover="this.style.color='#ffc';this.style.ba ckgroundColor='#004';"
onmouseout="this.style.color='#000';this.style.bac kgroundColor='#fff';"
>magic text</span>.</p>


This should work in Internet Explorer 4+ and Opera 5+ assuming JavaScript
enabled, and as a bonus will work in Netscape 6+ and Opera 7+ even if
JavaScript is disabled!

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132

 
Reply With Quote
 
 
 
 
some dude somewhere
Guest
Posts: n/a
 
      10-17-2003
YIHAAAA, Toby is tha MAN!!!!!

Thanks!

Eric



"Toby A Inkster" <> schreef in bericht
news. ..
> some dude somewhere wrote:
>
> > But is there also a way to change the color of your text (plain body

text,
> > NO hyperlinks)?

>
> The neat way to do this is to use CSS. In your style sheet, put say:
>
> .magic:hover {
> background-color: #004;
> color: #FFC;
> }
>
> and then in your HTML:
>
> <p>Here is a paragraph with some <span class="magic">magic

text</span>.</p>
>
> However, this doesn't work in Internet Explorer (only in Netscape>6 and
> Opera>7). If you want IE support, do the same as above but then add some
> JavaScript events:
>
> <p>Here is a paragraph with some <span class="magic"
> onmouseover="this.style.color='#ffc';this.style.ba ckgroundColor='#004';"
> onmouseout="this.style.color='#000';this.style.bac kgroundColor='#fff';"
> >magic text</span>.</p>

>
> This should work in Internet Explorer 4+ and Opera 5+ assuming JavaScript
> enabled, and as a bonus will work in Netscape 6+ and Opera 7+ even if
> JavaScript is disabled!
>
> --
> Toby A Inkster BSc (Hons) ARCS
> Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To reduce your body weight & slim your body Loss weight MCSA 0 07-23-2007 07:54 PM
To reduce your body weight & slim your body Loss weight MCSA 0 07-21-2007 05:15 AM
Adobe After Effects 7.0 PRO, Adobe Premiere Pro 2.0 for Windows XP, and tutorials, Adobe After Effects Plugins Collection (WINMAC), updated 19/Jan/2006 code_fu@pathfinder.gr Digital Photography 0 02-02-2006 06:52 AM
all the text (including tags) between <body> .. </body> tarakparekh@yahoo.com Perl Misc 5 09-07-2005 11:40 PM
Not detecting body.scrollTop and body.scrollLeft in IE6 London Boy Javascript 2 01-12-2004 08:44 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57