Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mouse rollover 1

Status
Not open for further replies.

hcubed

IS-IT--Management
May 9, 2002
100
AU
Could someone please give me the html code that I can put into my webpage that will change the color of text for example "home" which is in blue to change to orange when you move your mouse over the text
 
Hi,

Put this in the head of your HTML file:

<STYLE TYPE=&quot;text/css&quot;>
A:link {TEXT-DECORATION: none; color: blue;}
A:visited {TEXT-DECORATION: none}
a:hover {TEXT-DECORATION: none; color: orange;}
</STYLE>

BTW - This will make all links do this. If you want to specify different colors for different links then let me know, and I'll give you some different code.

Hope this helps! NATE
spyderix.gif

design@spyderix-designz.com
 
spyderix

God that was quick!!! thanks mate, yes I would love to have different code for example to get the text to bold and be underlined when someone scrolls over and antyinh else you might think looks cool

thank you very very much for your help
 
and also to specify different colors for different links

thanks again
 
Some examples:
<STYLE>
.div1 A:hover{text-decoration:eek:verline;background-color:#cccccc;}
.div2 A:hover{font-size:26px;font-weight:900;font-style:italic;color:red;}
</STYLE>
<div class=&quot;div1&quot;>
<a href=&quot;1&quot;>1</a><a href=&quot;2&quot;>2</a><a href=&quot;3&quot;>3</a><a href=&quot;4&quot;>4</a><a href=&quot;5&quot;>5</a><a href=&quot;6&quot;>6</a><a href=&quot;7&quot;>7</a><a href=&quot;8&quot;>8</a><a href=&quot;9&quot;>9</a>
</div>
<div class=&quot;div2&quot;>
<a href=&quot;1&quot;>1</a><a href=&quot;2&quot;>2</a><a href=&quot;3&quot;>3</a><a href=&quot;4&quot;>4</a><a href=&quot;5&quot;>5</a><a href=&quot;6&quot;>6</a><a href=&quot;7&quot;>7</a><a href=&quot;8&quot;>8</a><a href=&quot;9&quot;>9</a>
</div>
Really, you can use any style tag at all in that. Here is a list of them.

Rick If I have helped you just click the first link below to let me know :)
 
Hi again,

Put this into the head of your HTML:

<STYLE TYPE=&quot;text/css&quot;>
.link1
{COLOR: blue; TEXT-DECORATION: none; font-family: times new roman; font-weight: bold;}
a:link.link1 {TEXT-DECORATION: none; color : blue;}
a:visited.link1 {color : #008000;}
a:hover.link1 {color : #008000; text-decoration: underline overline; font-family: arial; font-weight: bold; font-size: 16px; font-style:italic;}
</STYLE>

then put the following into your LINK TAG:

<A HREF=&quot;your_link.html&quot; CLASS=&quot;link1&quot;>LINK</A>

Notice how above the first part of the style is .link1 well that is what you put in the CLASS=&quot;&quot; in the LINK TAG. When you create a new set of link attributes then you can copy paste alot of the stuff above but put it into .link2{stuff goes here}, then call it CLASS=&quot;link2&quot;.

You can call your style whatever you want (eg- .123asdlinkfef) but your class has to match it- CLASS=&quot;123asdlinkfef&quot;

Hope this helps!
NATE
spyderix.gif

design@spyderix-designz.com
 
Thanks spyderix

The code is great which you gave me, now to really test your skills:) Below is code to open the links in a new window, every time someone clicks on one, is it possible to have them open up in seperate windows and also have this code also have the initial code

thanks
hcubed


<p><a href=&quot;javascript:pop(' color=&quot;#003399&quot;>Sea
World</font></b></a><br>
<a href=&quot;javascript:pop(' color=&quot;#003399&quot;>Dreamworld</font></b></a><br>
<a href=&quot;javascript:pop(' color=&quot;#003399&quot;>Movieworld</font></b></a><br>
<a href=&quot;javascript:pop(' color=&quot;#003399&quot;>Great
Barrier Reef</font></b></a><br>
<a href=&quot;javascript:pop(' color=&quot;#003399&quot;>Wale
Watching Tours</font></b></a><br>
<a href=&quot;javascript:pop(' color=&quot;#003399&quot;>Stockmans
Hall of Fame</font></b></a><br>
<a href=&quot;javascript:pop(' color=&quot;#003399&quot;>Australia
Outback Adventures</font></b></a><br>
<a href=&quot;javascript:pop(' color=&quot;#003399&quot;>Australia
Zoo</font></b></a><br>
<br>
 
Hi,

Simply add TARGET=&quot;_blank&quot; to every single link tag:

Code:
<A HREF=&quot;[URL unfurl="true"]www.tek-tips.com&quot;[/URL] TARGET=&quot;_blank&quot;>Tek-Tips</A>

Then when a user clicks on each of the seperate links they will open open in new windows. And when a user has a window open and clicks on another link it will open another new window instead of putting it in the already open and hidden window.

Hope this helps! NATE
spyderix.gif

design@spyderix-designz.com
 
Oh sorry one more thing.

Change all your tags to look like my example above. Don't put in: javascript:pop('

So do it like this:

Code:
<p>
<a href=&quot;[URL unfurl="true"]http://www.seaworld.com.au/[/URL] TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Sea World</font></b></a>
<br>
<a href=&quot;[URL unfurl="true"]http://www.dreamworld.com.au/&quot;[/URL] TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Dreamworld</font></b></a><br>

etc...

Hope this helps! NATE
spyderix.gif

design@spyderix-designz.com
 
Hi,

Sorry when I copy and pasted your link I accidentally deleted the closing quotation mark for the link.

It should read like this, this is correct:

Code:
<p>
<a href=&quot;[URL unfurl="true"]http://www.seaworld.com.au/&quot;[/URL] TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Sea World</font></b></a>
<br>
<a href=&quot;[URL unfurl="true"]http://www.dreamworld.com.au/&quot;[/URL] TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Dreamworld</font></b></a><br>

etc...

Sorry about the screw-up there. That will now work.

Hope this helps! NATE
spyderix.gif

design@spyderix-designz.com
 
Ok Nate I have noted your email, where are you from? and one last question:
where do i put in the code to change the color of the link with this??


<p> <a href=&quot; TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Sea
World</font></b></a> <br>
 
Hi,

I'm from ROSSLAND-BC-CANADA. Where are you from? (I'm guessing not in North America b/c it is soo late. I have 1:00 AM here)

Code:
<a href=&quot;[URL unfurl="true"]http://www.seaworld.com.au/&quot;[/URL] TARGET=&quot;_blank&quot; [b]CLASS=&quot;your_class_name&quot;[/b]><b><font color=&quot;#003399&quot;>SeaWorld</font></b></a>

What ever you called your class name in the <STYLE> tag is what you put in the link tag, but without the &quot;.&quot; And b/c you are using CSS to specify the color you don't need <FONT COLOR=&quot;#003399&quot;> in any of your links.

Do note in the link above Tek-Tips has put an extra &quot;;&quot; you will need to erase that so that the link works properly.

Hope this helps! NATE
spyderix.gif

design@spyderix-designz.com
 
this code (from SPYDERIX Tip) IS your link

Code:
<a href=&quot;[URL unfurl="true"]http://www.seaworld.com.au/&quot;[/URL] TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Sea World</font></b></a>

why not thanks SPYDERIX aka NATE with a star ? ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
mmmm doesn't seem to work

this is what I have for the other links which works fine

<A HREF=&quot;event_torn.htm&quot; CLASS=&quot;Link1&quot;>click here</A><a href=&quot;event_torn.htm&quot;>.</a><br>
 
Hi,

Why do you have 2 <A HREF>'s like that?

Show me your <STYLE> tags that you are using and the link tags that you are using and tell me exactly what you want to do (what effects).

Where are you from?

Hope this helps! NATE
spyderix.gif

design@spyderix-designz.com
 
<STYLE TYPE=&quot;text/css&quot;>
.Link1
{COLOR: #003399; TEXT-DECORATION: none; font-family: verdana;font-size: 11px; font-weight: bold;}
a:link.Link1 {TEXT-DECORATION: none; color :#003399;}
a:visited.Link1 {color : #003399;}
a:hover.Link1 {color : #ff9900; text-decoration: underline; font-family: verdana; font-weight: bold; font-size: 11px; font-style:italic;}
</STYLE>

<a href=&quot; TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Sea World</font></b></a>
<br>
<a href=&quot; TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Dreamworld</font></b></a>
<br>
<a href=&quot; TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Movieworld</font></b></a>
<br>
<a href=&quot; TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Great
Barrier Reef</font></b></a> <br>
<a href=&quot; TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Wale
Watching Tours</font></b></a> <br>
<a href=&quot; TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Stockmans
Hall of Fame</font></b></a> <br>
<a href=&quot; TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Australia
Outback Adventures</font></b></a> <br>
<a href=&quot; TARGET=&quot;_blank&quot;><b><font color=&quot;#003399&quot;>Australia
Zoo</font></b></a><br>
<br>


what I'm trying to do is get the links to go from blue bold verdana to underlined orange verdana and have each link open up into a new page.

I'm from Australia, but where r u from:)
 
Hi,

I already said where I was from:
&quot;I'm from ROSSLAND-BC-CANADA. Where are you from? (I'm guessing not in North America b/c it is soo late. I have 1:00 AM here)&quot; (see it above 5 posts up) It's now 2:12 AM ;-)

Anyway, I can see the problem already. You haven't specified the link tags with a class.

Here is the code for you. Just copy and paste this all into your HTML file: (I have organized it better too)
---------------------------------
Code:
<STYLE TYPE=&quot;text/css&quot;>
.link1 
{
TEXT-DECORATION: none; color: #003399; font-family: verdana; font-size: 11px; font-weight: bold;
}
a:link.link1
{
TEXT-DECORATION: none; color: #003399; font-family: verdana; font-size: 11px; font-weight: bold;
}
a:visited.link1
{
TEXT-DECORATION: none; color: #003399; font-family: verdana; font-size: 11px; font-weight: bold;}
a:hover.link1
{
text-decoration: underline; color: #ff9900; font-family: verdana; font-weight: bold; font-size: 11px;
}
</STYLE>



<a href=&quot;[URL unfurl="true"]http://www.seaworld.com.au/&quot;[/URL] TARGET=&quot;_blank&quot; CLASS=&quot;link1&quot;>Sea World</a>
<br>
<a href=&quot;[URL unfurl="true"]http://www.dreamworld.com.au/&quot;[/URL] TARGET=&quot;_blank&quot; CLASS=&quot;link1&quot;>Dreamworld</a> 
<br>
<a href=&quot;[URL unfurl="true"]http://www.movieworld.com.au/&quot;[/URL] TARGET=&quot;_blank&quot; CLASS=&quot;link1&quot;>Movieworld</a> 
<br>
<a href=&quot;[URL unfurl="true"]http://www.great-barrier-reef.com/&quot;[/URL] TARGET=&quot;_blank&quot; CLASS=&quot;link1&quot;>Great Barrier Reef</a>
<br>
<a href=&quot;[URL unfurl="true"]http://www.seefraserisland.com/ww/ww.html&quot;[/URL] TARGET=&quot;_blank&quot; CLASS=&quot;link1&quot;>Whale Watching Tours</a>
<br>
<a href=&quot;[URL unfurl="true"]http://www.outbackheritage.com.au/&quot;[/URL] TARGET=&quot;_blank&quot; CLASS=&quot;link1&quot;>Stockmans Hall of Fame</a>
<br>
<a href=&quot;[URL unfurl="true"]http://www.infocus.to/outback/&quot;[/URL] TARGET=&quot;_blank&quot; CLASS=&quot;link1&quot;>Australia Outback Adventures</a>
<br>
<a href=&quot;[URL unfurl="true"]http://www.crocodilehunter.com/index1.html&quot;[/URL] TARGET=&quot;_blank&quot; CLASS=&quot;link1&quot;>Australia Zoo</a>
---------------------------------

I have tested this too and it works exactly the way you want it to. I also corrected your spelling of &quot;Whale&quot;. I do note that &quot;Australia Outback Adventures&quot; link comes up as a non-existant site, is your URL correct???

BTW - Tek-Tips has turned every word (link1) into a link. Just ignore that.

Hope this helps! NATE
spyderix.gif

design@spyderix-designz.com
 
Once again I thank you Nate, I will email you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top