Jump to content

Can I define an ID selector as a style of "external" class


amakeler

Recommended Posts

Hi all, RE: Can I define an ID selector as a style of "external" class?I have this ID selector in a DWT file, as follows:

#masthead a { /* Keep button for current page "pressed"*/ color: #FFDDEB; text-decoration: none; /* 3-D - Non-pushed ... */ background-color: #FF468B; position: relative; top: 1px; left: 1px; border-color: #000 #aaa #aaa #000; }

To keep a long story short, it seems that this ID selector must be in the file.Now. since the CSS code inside the {...} is also being used elsewhere, I need a way that I can take out that block of CSS code lines, make it "external", and replace it with some reference. e.g., can I do something like: $masthead <external class> aso that the #masthead ID selector is defined as a style of the same type as <external class>, where <external class> is defined in my main CSS stylesheet?In 'C' I would just declare a text macro using #define. I am using MS Expression Web. tia- avi

Link to comment
Share on other sites

no, you can't use a class in that manner, but you can give the element both an ID and a class at the same time.

<div id="id-name" class="external">	 blah, blah 	 </div>

Link to comment
Share on other sites

And you can also assign multiple classes to a single element:

<div id="id-name" class="class1 external class3">blah blah</div>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...