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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Hover Effects in MX

Status
Not open for further replies.

2760

Instructor
Nov 10, 2002
34
GB
Hi all,

Is there a way in MX that i can create multiple hover effects for different links?
i.e.) i've got two links on my webpage that i want in different colours and i want one of them to hover in blue (for example) and the other in red. Can this be done?

Thanks in Advance.
 
a.blue {color: black;}
a.blue:hover {color: blue;}
a.red {color: black;}
a.red:hover {color: red;}

<a href=&quot;blue.htm&quot; class=&quot;blue&quot;>I am a blue hover link</a>
<a href=&quot;red.htm&quot; class=&quot;red&quot;>I am a red hover link</a> [Hammer]
Nike Failed Slogans -- &quot;Just Don't Do It!&quot;
 
I'm new to MX, so i'm a little confused.
I've got two sets of links that are the same colour (white - #FFFFFF) but they're on two different coloured backgrounds; one set on skin colour background - #E6E6DC and the other on a grey background - #3399CC) now the white links on the grey are hovering yellow - which is what i want as its really visible - but the white links on the skin colour background aren't really visible - hence i want to change its colour and also want a different hover colour to yellow which, unlike the grey background, will not show up well on the skin coloured background. What i'm after is code which will enable me to operate two different active link colours and hover colours, and some assistance on where to insert it into the HTML code.

Thanks in Advance.
 
i could just tell you what to do but then that wouldnt help right

go to and go to their tutorial on CSS

the classes i gave you in my first reply are your classes to use. After you have your page set up with the classes defined is it still doesn't work then you can post your page code and I will be glad to help you.

A few tips

1) your classes go in between your head tags at the top of the page like the following
<style type=&quot;text/css&quot;>
<!--
Put your Classes Here
-->
</style>
2) a style of &quot;A&quot; is different from a style of &quot;a&quot;
3) keep them organized

From what I've told you you really dont need but it is helpful. [Hammer]
Nike Failed Slogans -- &quot;Just Don't Do It!&quot;
 
Hi,

I can't figure it out, so as you said you'd be happy to help, i've uploaded the page for you to have a look at the HTML/CSS;


...could you have a play around with the code and see if you can fix the problem. The white links in the top nav bar i want left as they are, but the links on the main page (which are clearly not very visible) i want the following done to them;

a:link {color:#0000FF ; text-decoration: none; }
a:active {color: #0000FF; text-decoration: none; }
a:visited {color: #6699FF; text-decoration: none; }
a:hover {color: #0066FF; text-decoration: none; }

; and as i've said, i want the links in the nav bar under the title to remain as they are. If you can assist, i'd be very grateful. Thanks.
 
this is what have

<html>
<head>
<style type=&quot;text/css&quot;>
<!--
a:link {color:#FFFFFF ; text-decoration: none; }
a:active {color: #FFFFFF; text-decoration: none; }
a:visited {color: #FFCC33; text-decoration: none; }
a:hover {color: #FFFF00; text-decoration: none; }
-->
</style>
<title>Welcome to Routemasters Remembered! - Home Page</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body bgcolor=&quot;#E6E6DC&quot; text=&quot;#000000&quot; leftmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;>
<table width=&quot;98%&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<tr>
<td width=&quot;44%&quot; height=&quot;71&quot;><img src=&quot;title1.gif&quot; width=&quot;346&quot; height=&quot;18&quot;></td>
<td width=&quot;54%&quot;>&nbsp;</td>
<td width=&quot;2%&quot;><div align=&quot;right&quot;><img src=&quot;title2.gif&quot; width=&quot;90&quot; height=&quot;67&quot;></div></td>
</tr>
</table>
<table width=&quot;100%&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; bgcolor=&quot;#006699&quot;>
<tr>
<td height=&quot;19&quot;> <strong><font color=&quot;#006699&quot; size=&quot;1&quot; face=&quot;Tahoma&quot;>..</font><font color=&quot;#FFFFFF&quot; size=&quot;1&quot; face=&quot;Tahoma&quot;><a href=&quot; PAGE</a> | <a href=&quot; HISTORIES (1970-1994)</a> | <a href=&quot; IN FOCUS</a> | <a href=&quot; &amp; CELEBRATIONS</a> | <a href=&quot; PAGES</a></font></strong></td>
</tr>
</table>
<p align=&quot;center&quot;><font size=&quot;2&quot; face=&quot;Tahoma&quot;>Welcome to Routemasters Remembered!
This site is an illustrated history of London's Routemaster buses in service
in the City of London, the surrounding districts and the rest of the UK from
1970 up until the privatization of London Buses Ltd. in 1994.<strong><br>
<a href=&quot; out
more here</a></strong><a href=&quot; </a></font></p>
<p align=&quot;center&quot;>&nbsp;</p>
<p align=&quot;center&quot;><font size=&quot;2&quot; face=&quot;Tahoma&quot;>Please sign the <a href=&quot; before you go. Many thanks.</font></p>
<p align=&quot;center&quot;>&nbsp;</p>
<p align=&quot;center&quot;><font size=&quot;2&quot; face=&quot;Tahoma&quot;>This website has been created with
<a href=&quot; Dreamweaver MX</strong></a>&copy; and <a href=&quot; Fireworks MX</strong></a>&copy;<br>
Best viewed on Internet Explorer 4.0+ at a resolution of 800x600</font></p>
<table width=&quot;100%&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; bgcolor=&quot;#006699&quot;>
<tr>
<td height=&quot;19&quot;><div align=&quot;center&quot;><strong><font color=&quot;#FFFFFF&quot; size=&quot;2&quot; face=&quot;Tahoma&quot;>Routemasters
Remembered &copy; Alan Jones 2003</font></strong></div></td>
</tr>
</table>
</body>
</html>

i would suggest making subclasses ike such

a.nav:link {color:#FFFFFF ; text-decoration: none; }
a.nav:active {color: #FFFFFF; text-decoration: none; }
a.nav:visited {color: #FFCC33; text-decoration: none; }
a.nav:hover {color: #FFFF00; text-decoration: none; }
a.body:link {color: #0000FF ; text-decoration: none; }
a.body:active {color: #0000FF ; text-decoration: none; }
a.body:visited {color: #0066FF; text-decoration: none; }
a.body:hover {color: #0066FF; text-decoration: none; }

So your navbar lins would be like such

<a href=&quot; class=&quot;nav&quot;>HOME
PAGE</a>

and yourother links like so

<a href=&quot; class=&quot;body&quot;>Find out
more here</a>

you can have as many pseudo classes for an element like i showed you
[Hammer]
Nike Failed Slogans -- &quot;Just Don't Do It!&quot;
 
Hi 2760,

The site you need is
This is a nice easy tutorial which will solve your problem. Also, I suggest

1 Use an external stylesheet
2 Set ALL your formatting in your stylesheet, not just the links
3 Set the body style links in the stylesheet for the body text, this does not get applied, it just IS.
4 Set your navbar style in the stylesheet and apply the navbar class to the <TR> tag which holds the navigation text. (it is only applied once, not to every occurrence of a link).

Once you start using CSS you'll wonder what took you so long to cotton on.

Good luck.
Jill.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top