By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,846 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,846 IT Pros & Developers. It's quick & easy.

rollover effect

P: n/a

I'm currently in the process of replacing a few rollover images, use
for anchors, with text. I know how to change the hover and link colo
attribute for all <a> hyperlink tags, but I don't want to change the
all. How can I set hover and link attributes for a class

domece
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message44657.htm

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <do************@mail.forum4designers.com>,
domeceo <do************@mail.forum4designers.com> wrote:

I'm currently in the process of replacing a few rollover images, used
for anchors, with text. I know how to change the hover and link color
attribute for all <a> hyperlink tags, but I don't want to change them
all. How can I set hover and link attributes for a class?


a.class:hover { property: attribute; }

If there's several anchor tags together that you want to replace (like
a menu), you can include them in a single div and set the attributes
like that.

For example (from a current project of mine):

..nav a {
padding: 2px 10px;
color: #f00;
background-color: #ff0;
font-family: Arial, Verdana, sans-serif;
font-weight: bold;
text-decoration: none;
}

..nav a:visited
{
color: #f00;
}

..nav a:hover, .nav ul li a:active
{
color: #ff0;
background-color: #f00;
}
Then the HTML is something like:

<div class="nav">
<a href="one.html">First</a>
<a href="two.html">Second</a>
<a href="three.html">Third</a>
</div>

--
lkseitz (Lee K. Seitz) .at. hiwaay @dot@ net
"From there to here, and here to there, funny things are everywhere."
-- Dr. Seuss, _One Fish, Two Fish, Red Fish, Blue Fish_
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.