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 13 December 2011, 06:43 PM
  #1  
ScoobyWon't
Scooby Regular
Thread Starter
 
ScoobyWon't's Avatar
 
Join Date: May 2002
Location: Pot Belly HQ
Posts: 16,694
Likes: 0
Received 0 Likes on 0 Posts
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?
Old 14 December 2011, 09:03 AM
  #2  
f1_fan
Scooby Regular
iTrader: (9)
 
f1_fan's Avatar
 
Join Date: Mar 2004
Location: .
Posts: 20,035
Likes: 0
Received 0 Likes on 0 Posts
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;}
Old 14 December 2011, 06:36 PM
  #3  
ScoobyWon't
Scooby Regular
Thread Starter
 
ScoobyWon't's Avatar
 
Join Date: May 2002
Location: Pot Belly HQ
Posts: 16,694
Likes: 0
Received 0 Likes on 0 Posts
Default

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



Quick Reply: CSS strife



All times are GMT +1. The time now is 03:51 AM.