simple problem

liunx

Guest
I've never had to worry about this before, it's so simple bu I don't knwo how to do it! How do you make it so that a text link changes color when you hover over it with the mouse? Mine will not change colors!<!--content-->post what you have, lets take a look.<!--content-->For all the links in your document: in your stylesheet place the following, and see what happens; (change the color values and experiment until you get what you want).<br />
<br />
a, a:link { color: #0066CC;}<br />
a:visited { color: #0066CC;}<br />
a:active { color: #0066CC;}<br />
a:hover { color: #C40000;}<br />
<br />
<br />
--------------------------------<br />
<br />
to assign a particular class to some links only, for example, only for the navigation menu links:<br />
<br />
a.menu, a.menu:link { color: #C40000;}<br />
a.menu:visited { color: #C40000;}<br />
a.menu:active { color: #C40000C;}<br />
a.menu:hover { color: #0066CC;}<br />
<br />
----------------------------<br />
then assing a class to a link:<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"menu1.htm" class="menu">menu item</a><!--content-->btw, You can use color names instead, as opposed to hex values. Works a lot easier than converting to hex value.<!--content-->Originally posted by steelersfan88 <br />
btw, You can use color names instead, as opposed to hex values. Works a lot easier than converting to hex value. <br />
<br />
yep, for web-safe colors.<!--content-->Yes you could steelersfan but that would then make your css invalid:(<!--content-->Originally posted by sharkey <br />
Yes you could steelersfan but that would then make your css invalid:( <br />
How do you figure?<!--content-->As stated here (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-CSS2/colors.html#colors">http://www.w3.org/TR/REC-CSS2/colors.html#colors</a><!-- m -->)<br />
14.1 Foreground color: the 'color' property<br />
<br />
'color' <br />
Value: <color> | inherit <br />
Initial: depends on user agent <br />
Applies to: all elements <br />
Inherited: yes <br />
Percentages: N/A <br />
Media: visual <br />
<br />
This property describes the foreground color of an element's text content. There are different ways to specify red: <br />
<br />
Example(s):<br />
<br />
EM { color: red } /* predefined color name */<br />
EM { color: rgb(255,0,0) } /* RGB range 0-255 */It later goes on to say the hex value is as well ok, obviously.<!--content-->
 
Back
Top