Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Ezilon Directory   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 12-02-2003, 08:11 AM   #1 (permalink)
Inactive
 
Join Date: 10-29-03
Posts: 10
iTrader: 0 / 0%
Latest Blog:
None

amyinomaha is liked by many
Multiple CSS Classes on a Page?

I need to have multiple CSS classes on a page for the links. For instance, the links on the left hand navigation area are set up correctly - with the white. However, I want to have different colors for the email links on the right hand "main" area as white doesn't work because of the background color. How do I do this?

Example:
http://www.amcon.com/amy/ipg/contractvoice.html
amyinomaha is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 12-02-2003, 08:13 AM   #2 (permalink)
No Longer Here
 
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
iTrader: 0 / 0%
Latest Blog:
None

Jazzee is liked by somebodyJazzee is liked by somebodyJazzee is liked by somebodyJazzee is liked by somebodyJazzee is liked by somebody
Set different classes for different links.

Example
a.leftnav: color you want;

In Page:
<a class="leftnav"...
Jazzee is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-02-2003, 08:16 AM   #3 (permalink)
Inactive
 
Join Date: 10-29-03
Posts: 10
iTrader: 0 / 0%
Latest Blog:
None

amyinomaha is liked by many
Please bear with me... I'm just learning this CSS stuff now. Heheh. Okay, so right now, I have this:

<STYLE TYPE="text/css">
<!-- A:link, A:active
{
text-decoration : none;
background : transparent;
}
A:visited
{
text-decoration : none;
background : transparent;
color: #FFFFFF;
}
A:hover
{
text-decoration : none;
background : transparent;
color: #C9D9E1;
}
</STYLE>



So, how exactly do I set it up then to have the different classes?
amyinomaha is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-02-2003, 08:32 AM   #4 (permalink)
No Longer Here
 
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
iTrader: 0 / 0%
Latest Blog:
None

Jazzee is liked by somebodyJazzee is liked by somebodyJazzee is liked by somebodyJazzee is liked by somebodyJazzee is liked by somebody
Make your stylesheet look like this (notice I added the leftnav stuff at the bottom):

[code:1:340f0f707b]<STYLE TYPE="text/css">
<!-- A:link, A:active
{
text-decoration : none;
background : transparent;
}
A:visited
{
text-decoration : none;
background : transparent;
color: #FFFFFF;
}
A:hover
{
text-decoration : none;
background : transparent;
color: #C9D9E1;
}

A:link.leftnav, A:active.leftnav
{
text-decoration : none;
background : transparent;
}
A:visited.leftnav
{
text-decoration : none;
background : transparent;
color: #FFFFFF;
}
A:hover.leftnav
{
text-decoration : none;
background : transparent;
color: #C9D9E1;
}

</STYLE> [/code:1:340f0f707b]


Everything with leftnav after it above should have the left and top nav colors that you want. Make the other ones at the top have what you want your main content colors to have.

Then in your page, change all the links in the left and top nav bars to have class="leftnav" inside the tags. Like this:

[code:1:340f0f707b]<a class="leftnav" href="index.html">[/code:1:340f0f707b]


Make sense? I am not very good at explaining things.
Jazzee is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-02-2003, 09:11 AM   #5 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
You are missing the Cascade boat there!
if your middle section has a class="mid_section" then the following rules will do the trick wihtout needing to set the class="" on each <a> element.
[code:1:d3d5311671]
<style>
a:visited { color: white; }
.mid_section a:visited {colour: darkblue; }
</style>

<div class="mid_section">
<a href="...">link in the mid section will be darkblue after it's visited</a>
</div>
<a href="...">link OUT of the mid section will be white after it's visited</a>
[/code:1:d3d5311671]
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-02-2003, 10:20 AM   #6 (permalink)
No Longer Here
 
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
iTrader: 0 / 0%
Latest Blog:
None

Jazzee is liked by somebodyJazzee is liked by somebodyJazzee is liked by somebodyJazzee is liked by somebodyJazzee is liked by somebody
Hmmm... I thought the way I did it would be easier to explain
Jazzee is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-02-2003, 09:49 PM   #7 (permalink)
Inactive
 
Join Date: 10-13-03
Posts: 275
iTrader: 0 / 0%
Latest Blog:
None

Distorted is on the right pathDistorted is on the right path
I think that jazzee's way is better since it will only change the links with the class, and not every link within a parent with the class.

^Just my opinion

Or you could just put both methods into one.

[code:1:9d3bfa6f52]
div#navigation a.leftNav {display: block; text-decoration: none;}
div#navigation a:hover.leftNav {background-color: black; color: white;}
[/code:1:9d3bfa6f52]
Distorted is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-03-2003, 01:42 AM   #8 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
the whole idea of CSS is that you don't have to add mark-up to every HTML element.

i was not saying the code i put should do everything he want's sraight awaym u need other rules, using mine as a demonstration of utilising cascade it shouldn't be hard to apply to whatever element u want, and to add rules for :hover :link as well as :active

I was also not introducing # selectors as he seemed happy using classes, and leaving it that was less complicated I didn't want to try introducing the other concept at the same time!
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-03-2003, 06:55 AM   #9 (permalink)
Inactive
 
Join Date: 10-13-03
Posts: 275
iTrader: 0 / 0%
Latest Blog:
None

Distorted is on the right pathDistorted is on the right path
I'm sorry. I understand what you're saying now.
Distorted is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-03-2003, 07:14 AM   #10 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
lol good, maybe i should have explained it better, i was in a rush !
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting Page impressions with multiple ads? johnegood Webmaster Revenue 0 07-04-2007 11:54 AM
Multiple Flash Movies On One Page Collide StupidScript Coding Forum 0 10-11-2006 04:04 PM
Issue with multiple feeds on the same page I, Brian Coding Forum 9 12-17-2004 08:45 AM
Multiple Adsense/page! thebassman Contextual Networks 22 09-07-2004 12:11 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 07:47 PM.
© Copyright 2008 V7 Inc