PDA

View Full Version : Applying CSS to single layer


jasmine
11-13-2006, 11:34 PM
Hi Everyone!

Is there a way to apply CSS to a single layer, so that it's attributes are separate from the main CSS?

For example: I have a "main" CSS file built for all my pages so that headings, links, and such look the same from page to page. (i.e.: the "main" CSS for my links has the link colour as white.) But my layers have a white background. Can I apply a CSS to that layer to make the links in that layer only a different colour? Or is there another way around it?

I hope that made sense...Thanks as always for the response :)

domedia
11-14-2006, 02:40 PM
Hi Jasmine,
It's absolutely possible, you use CSS classes and ID's for this. Not as hard as you think and Adobe ahs a nice page explaining about it as well:
http://www.adobe.com/cfusion/knowledgebase/index.cfm?event=view&id=KC.tn_15350&extid=tn_15350&dialogID=38345787&iterationID=2&sessionID=48309937e3c731763e53&stateID=0+0+38347882&mode=simple

jasmine
11-14-2006, 03:03 PM
I will check that out! Thanks! :)

jasmine
11-14-2006, 03:38 PM
Well, I've looked at the link you've given me and some of the tutorials on this site too and I've figured something out.
I have a layer named News. So I just added #News in front of the CSS coding for the links in a different style sheet, which I attached to my main style sheet and presto! It only affected the links in my layers without changing the properties of my navigation. (The idea came from the tutorial actually. Only, they used tables instead of layers...)

domedia
11-14-2006, 03:49 PM
Yupp, you got it.
I wasn't sure if you were confortable writing directly into your CSS file, but yes that's the approach.

#idname a:link {color: green;}
#idname a:visited {color: green;}
#idname a:hover {color: black;}
#idname a:active {color: green;}

jasmine
11-14-2006, 05:06 PM
that's exactly what I've done! :) Thanks for the help