.layer vs #layer (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


briandina -> .layer vs #layer (1/3/2007 19:14:35)

I'm designing in DreamWeaver MX 2004.
Trying to position equal height layers in CSS within a wrapper so that layers will be of equal height regardless of the content in those layers.

I've run into a number of examples, but instead of using ".layer" they use "#layer"
Problems is, DreamWeaver won't let me let create CSS styles that start with "#"
I went into the code and changed the .layers to #layers but then I lose my ability create new layers using that CSS style.

So what's up with the ".layer vs. #layer" thing???
~Brian Dina
brian@briandina.com




jaybee -> RE: .layer vs #layer (1/3/2007 19:44:51)

If you specify .layer then you have to refer to it as class=
If you specify #layer then you refer to it as id=

You can only have one occurrence of each id= on a page. You can have many occurrences of class=

It's possible DW is objecting to multiple use of id or maybe that it only allows you to do classes and keeps ids for itself. Don't know for sure, don't use it.




sticks464 -> RE: .layer vs #layer (1/4/2007 0:01:09)

Briandina, you can still use the #(id) in Dreamweaver. Create your style as follows:
(I never tried this in design view, only code view. Make sure your cursor is positioned behind the element you want the style applied to or have the element highlighted.)

1. With the CSS Styles window open, click on the 'New CSS Rule' icon at the bottom of that window.
2. Choose 'Advanced(IDs, pseudo-class selectors) and in the Selector box type in the name (#layer) you want to name the element
3. Check the appropriate 'Define in' box and click OK. Select the external style sheet name from the dropdown or specify a new one or make the style embedded by selecting 'this document only'.





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875