?
Solved

Including one css class within another

Posted on 2004-08-24
3
Medium Priority
?
465 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 1500 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

801 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