Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Design Forum > Web Design & Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Web Design & Programming Discussion of web design, and server-side & client-side scripting

Reply
 
LinkBack Thread Tools
Old 04-23-2007, 09:15 AM   #1 (permalink)
Register user
 
Join Date: Mar 2007
Location: Tech Support Forum, Online - Otherwise Brighton, United Kingdom
Posts: 2,186
OS: Dual Booting - Windows XP Home Edition SP2 & Vista Home Premium

My System

Send a message via MSN to Jaymie1989
Text Colour Changes When Mouse Is Over It.

Hi I want a HTML so the colour of the text changes when the mouse hovers over it.

Also if you know a HTML code for hyperlinking pictures please let me know thanks.
Jaymie1989 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 04-23-2007, 09:25 AM   #2 (permalink)
Registered User
 
95five-0's Avatar
 
Join Date: Dec 2004
Location: Corinth, TX
Posts: 1,339
OS: 2000/XP/2003/Vista/2008


Send a message via MSN to 95five-0 Send a message via Yahoo to 95five-0
Re: Text Colour Changes When Mouse Is Over It.

In the <head> area add something along these lines:

<style type="text/css">
A:link { FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: Arial; TEXT-DECORATION: none }
A:visited { FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: Arial; TEXT-DECORATION: none }
A:hover { FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: Arial; TEXT-DECORATION: none}

</style>


then in the link itself add class="a:link" ie <a href= "..." class="a:link">
__________________
"If it's really a supercomputer, how come the bullets don't bounce off when I shoot it ?"

<<PC Pitstop>><< AVG Free>><<Spybot>><<Everest 2.0>><<Trend Micro House Call>><<HijackThis How-to>>
95five-0 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 04-23-2007, 03:33 PM   #3 (permalink)
Design Team
 
DJ-Zep's Avatar
 
Join Date: Mar 2006
Location: Philadelphia
Posts: 1,541
OS: Windows Vista Home Premium (x64)

My System

Re: Text Colour Changes When Mouse Is Over It.

95's suggestion is for links.

If you just want to change normal text's color, use this code:
Code:
<font color="ORIGINAL COLOR" onmouseover="color='HOVER COLOR'" onmouseout="color='ORIGINAL COLOR'">Test</font>
Any questions, just ask.

Technical explanation:
I used the javascript onmouseover function to change the attribute color when you hover over the text. I used the javascript function onmouseout to return it to the original color that it was.
__________________
Nice music blog

Nvu || Notepad++ || Apache || PHP || Keep TSF Alive

"The great thing about a computer notebook is that no matter how much you stuff into it, it doesn't get bigger or heavier."

Last edited by DJ-Zep; 04-23-2007 at 03:35 PM. Reason: bold text = pretty
DJ-Zep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 04-23-2007, 08:35 PM   #4 (permalink)
Registered User
 
Join Date: Aug 2005
Location: Ohio
Posts: 207
OS: VISTA


Re: Text Colour Changes When Mouse Is Over It.

well they took care of the color changeing as for the hyperlinking of pictures its the same as a text hyperlink except you put the img tag with it

Code:
<a href = "http://www.yahoo.com"><img src="dark d.jpg" border = 0></img></a>

// replace www.yahoo.com with the url of your choosing but leave the http://

// dark d.jpg gets replaced with the path to the image

// if you want a border then take out boreder = 0 other wise leave it
Damion is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 04-24-2007, 06:27 AM   #5 (permalink)
Retired
 
gamerman0203's Avatar
 
Join Date: Oct 2005
Location: Grand Rapids, MI
Posts: 2,144
OS: XP MCE, Ubuntu Gutsy

My System

Re: Text Colour Changes When Mouse Is Over It.

95 and DJ's method's would both work fine. I personally would go with 95's because the <font> tag used in DJ's example is a depreciated tag and will be phased out. As a variation of DJ's method, you could do this:

<span style="color:ORIGINAL COLOR" onmouseover="this.style.color='HOVER COLOR'" onmouseout="this.style.color='ORIGINAL COLOR'">Test</span>

You can also have several different links with different colors using either method, but 95's would be easier to do. Example:

<style type="text/css">
a:link { FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: Arial; TEXT-DECORATION: none }
a:visited { FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: Arial; TEXT-DECORATION: none }
a:hover { FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: Arial; TEXT-DECORATION: none}
The above will affect every link placed on the page.

a.link1:link { FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: Arial; TEXT-DECORATION: none }
a.link1:visited { FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: Arial; TEXT-DECORATION: none }
a.link1:hover { FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: Arial; TEXT-DECORATION: none}
The above will affect only the links with a class designation of "link1". To get several different "classes" just copy and paste the above as many times as you have different links and then change "link1" to each links' class name.
</style>


By using the above example for several links, you can change the color in only one spot (the above the text) and it will automatically change it for every link on the page or every link with the proper class designation. That saves you from going to every link in the page and changing the color.

It is quite simple when you get the hang of it.
gamerman0203 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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 Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 04:07 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85