Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > a small CSS problem

a small CSS problem
Thread Tools
Mac Elite
Join Date: Apr 2003
Location: The City Of Diamonds
Status: Offline
Reply With Quote
Aug 27, 2004, 04:59 PM
 
Look here

I have a nav bar that uses the "hover" CSS thing. But I also have a link next to "email" that I want to change when hovered over. But, the text looks and acts the same as the navbar text. I want the mailto link to be an other size and other colour. How should I do this ?
     
Mac Elite
Join Date: Sep 2001
Location: The Land of Beer and Chocolates
Status: Offline
Reply With Quote
Aug 27, 2004, 05:21 PM
 
Originally posted by Powaqqatsi:
Look here

I have a nav bar that uses the "hover" CSS thing. But I also have a link next to "email" that I want to change when hovered over. But, the text looks and acts the same as the navbar text. I want the mailto link to be an other size and other colour. How should I do this ?
You probably want to define a separate link style for the navigation, which is easily done with your current html: to style the navigation links only, use ".nav a" and ".nav a:hover", for the general link style, just use "a" (make sure you define the general style first so the nav styles won't be overruled).
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Aug 27, 2004, 05:22 PM
 
Originally posted by Powaqqatsi:
Look here

I have a nav bar that uses the "hover" CSS thing. But I also have a link next to "email" that I want to change when hovered over. But, the text looks and acts the same as the navbar text. I want the mailto link to be an other size and other colour. How should I do this ?
Well there are a hundred ways you can do it, but I think the most efficient way would be to change:

Code:
a:visited { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #CCCCCC; text-decoration: none; } a:link { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #CCCCCC; text-decoration: none; } a:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; text-decoration: underline; } a:active { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; text-decoration: none; }
to

Code:
.nav a { color: #ccc; font: 10px Verdana, Arial, Helvetica, sans-serif; text-decoration: none } .nav a:hover { color: #000; text-decoration: underline }
and then add something like:

Code:
a { generic link style code here }
You would first target all the links in the navigation with the specific code, and then you could have the more general "link" style for things like the e-mail link. There's a lot more optimization that can be done.. but it looks like it was generated from some wysiwyg editor so I won't bug you about it

Edit: It looks like me and Jan have the same idea But it doesn't matter which comes first or not. Because ".nav a" has the extra class selector in there, it's more specific than the generic "a", so no conflict would occur, causing either selector's position in the stylesheet to change anything.
     
Mac Elite
Join Date: Apr 2003
Location: The City Of Diamonds
Status: Offline
Reply With Quote
Aug 28, 2004, 02:51 AM
 
Originally posted by Synotic:
There's a lot more optimization that can be done.. but it looks like it was generated from some wysiwyg editor so I won't bug you about it
Dreamweaver. What optimization could be done ? I'm always interested in optimization

Thanks for the help guys, I'll try this out.
(Last edited by Powaqqatsi; Aug 28, 2004 at 04:07 AM. )
     
   
Thread Tools
Forum Links
Forum 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 On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:12 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2