CSS strife
#1
Scooby Regular
Thread Starter
Join Date: May 2002
Location: Pot Belly HQ
Posts: 16,694
Likes: 0
Received 0 Likes
on
0 Posts
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?
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?
#2
Scooby Regular
iTrader: (9)
Join Date: Mar 2004
Location: .
Posts: 20,035
Likes: 0
Received 0 Likes
on
0 Posts
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;}
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;}
Thread
Thread Starter
Forum
Replies
Last Post