Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Problems with link colors
Old 03-12-2005, 01:32 PM Problems with link colors
wvmlt's Avatar
Experienced Talker

Posts: 46
Trades: 0
I want my header links and body links to have two different behaviors. Here's what I tried.

Code:
.header {
a:link { color: #FFFFFF; text-decoration: none; }
a:visited { color: #000000; text-decoration: none; }
a:hover { color: #fef72a; text-decoration: none; }
a:active {color: #46b238; text-decoration: none; }

}

.body {

a:link { color: #000000; text-decoration: none; }
a:visited { color: #000000; text-decoration: none; }
a:hover { color: #000000; text-decoration: none; }
a:active {color: #000000; text-decoration: none; }

}

For my links I use this
<div class="header"><a href=''>Header Link</a></div>
<div class="body"><a href=''>Body Link</a></div>
and it doesn't do anything. All the links are default colored and underlined! I have all the css code in a stylesheet and a link to it in my pages.
wvmlt is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-12-2005, 01:50 PM
GrayKard's Avatar
Skilled Talker

Posts: 72
Trades: 0
Ok, problem number one, you can't nest selectors like that, change it to this format:
Code:
a.header:link { color: #FFFFFF; text-decoration: none; }
a.header:visited { color: #000000; text-decoration: none; }
a.header:hover { color: #fef72a; text-decoration: none; }
a.header:active {color: #46b238; text-decoration: none; }


a.body:link { color: #000000; text-decoration: none; }
a.body:visited { color: #000000; text-decoration: none; }
a.body:hover { color: #000000; text-decoration: none; }
a.body:active {color: #000000; text-decoration: none; }
That makes a psuedo class.

Now the second problem. You need to put the class designation inside the links themselves:
HTML Code:
<div><a class="header" href=''>Header Link</a></div>
<div><a class="body" href=''>Body Link</a></div>
__________________

Please login or register to view this content. Registration is FREE
GrayKard is offline
Reply With Quote
View Public Profile
 
Old 03-15-2005, 03:39 PM
wvmlt's Avatar
Experienced Talker

Posts: 46
Trades: 0
Thanks, that did the trick.
wvmlt is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Problems with link colors
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20319 seconds with 12 queries