View Full Version : Applying CSS to single layer

11-13-2006, 10: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 :)

11-14-2006, 01: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:

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

11-14-2006, 02: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...)

11-14-2006, 02: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;}

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