Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

CSS strife

Thread Tools
 
Search this Thread
 
Old Dec 13, 2011 | 06:43 PM
  #1  
ScoobyWon't's Avatar
ScoobyWon't
Thread Starter
Scooby Regular
 
Joined: May 2002
Posts: 16,694
Likes: 0
From: Pot Belly HQ
Question CSS strife

Evening.

I'm coding some CSS by hand, which is something I haven't attempted since about 2004, and I'm having trouble getting the result I'm after.

I'd like to have a navigation menu on the left and main content on the right of the screen.

The left nav' bar has a dark background and requires white text, while the main content has a white background and requires black text. I'd like the links to follow that pattern.

I've written the CSS as I think I used to which is:


a.nav:link {color:white; text-decoration:none;}
a.nav:visited {color:white; text-decoration:none}
a.nav:hover {color:white; text-decoration:none;}

a.main:link {color:black; text-decoration:none;}
a.main:visited {color:black; text-decoration:none}
a.main:hover {color:black; text-decoration:none;}

If memory serves correctly, all I need to do is the class name in to specify which hyperlink style to use in each section?
Reply
Old Dec 14, 2011 | 09:03 AM
  #2  
f1_fan's Avatar
f1_fan
Scooby Regular
iTrader: (9)
 
Joined: Mar 2004
Posts: 20,035
Likes: 0
From: .
Default

Yep, that should work OK.

In the left just class your links thus:

<a class="nav" href="target">link</a>

and in the right;

<a class="main" href="target">link</a>

You might want to make your CSS look like this to include active links just to be sure:

a.nav:link {color:white; text-decoration:none;}
a.nav:active {color:white; text-decoration:none;}
a.nav:visited {color:white; text-decoration:none;}
a.nav:hover {color:white; text-decoration:none;}

a.main:link {color:black; text-decoration:none;}
a.main:active {color:black; text-decoration:none;}
a.main:visited {color:black; text-decoration:none;}
a.main:hover {color:black; text-decoration:none;}
Reply
Old Dec 14, 2011 | 06:36 PM
  #3  
ScoobyWon't's Avatar
ScoobyWon't
Thread Starter
Scooby Regular
 
Joined: May 2002
Posts: 16,694
Likes: 0
From: Pot Belly HQ
Default

Working nicely, thanks.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
anon_noone
Suspension
1
Jul 31, 2009 04:49 AM
GaryCat
Computer & Technology Related
4
Feb 15, 2007 11:39 AM
chump
Computer & Technology Related
1
Jan 6, 2006 09:35 PM




All times are GMT +1. The time now is 04:08 PM.