Solved

Including one css class within another

Posted on 2004-08-24
3
453 Views
Last Modified: 2013-11-18
Is there a way of including all the properties of one CSS class inside another. Like haing an include file reference on an asp page...

Thanks,

Jacob
0
Comment
Question by:jacobcolton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Expert Comment

by:webtrans
ID: 11879819
u can use the import tag inside ur CSS
below is an example

@import url(http://www.and.so.on.partial1.css);
0
 
LVL 18

Accepted Solution

by:
arantius earned 500 total points
ID: 11881297
The C in CSS stands for cascading.  If I have two separate classes that have all the same attributes except a few, I can specify it like this:

h1, h2 {
  font-style: italic;
  font-weight: bold;
  color: blue;
  border-bottom: 2px solid black;
}
h1 {
  font-size: 2em;
}
h2 {
  font-size: 1.5 em;
}

Then, h1 and h2 tags will have all the same font and color types, and just different sizes.  Is this what you mean?  Basically, you may separate any number of selectors with commas in your CSS declaration.
0
 
LVL 5

Expert Comment

by:pmsyyz
ID: 11883366
If you mean having two different classes apply to the same element, you use a space seperated list:

<p class="one two"></p>

If you mean including one css file inside another you can use @import as webtrans showed.
http://www.w3.org/TR/CSS21/cascade.html#at-import

@import url("mystyle.css");
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Make a website not indexable by google 6 36
Website Question - New Site 3 48
warning code: class php incomplete message 6 69
fillable forms on website 2 43
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question