473,394 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Include a style from another class

For example:

I have two css files. One with the class foo and one with the class bar:

foo.css:
---------
..foo {
font-size : 12px;
}

bar.css:
---------
..bar {
some include function here
}

What I want is that the class bar becomes exactly the same as foo.

Thanks!

StarQuake

--
for some how-to's and rpms visit my site : http://solid.bounceme.net
for commercially supported solutions visit : http://www.robas.com
Sep 20 '05 #1
5 17457
StarQuake schreef:
For example:

I have two css files. One with the class foo and one with the class bar:

foo.css:
---------
.foo {
font-size : 12px;
}

bar.css:
---------
.bar {
some include function here
}

What I want is that the class bar becomes exactly the same as foo.

Thanks!

StarQuake


Just call it .foo and the styles it will overrule (or supplement) the styles in the foo.css
--
Niek
Sep 20 '05 #2
'sNiek wrote:
StarQuake schreef:
For example:

I have two css files. One with the class foo and one with the class bar:

foo.css:
---------
.foo {
font-size : 12px;
}

bar.css:
---------
.bar {
some include function here
}

What I want is that the class bar becomes exactly the same as foo.

Thanks!

StarQuake


Just call it .foo and the styles it will overrule (or supplement) the
styles in the foo.css


Yes, that would be possible but the problem is I can't change the code
that refers to both foo.css and bar.css

So I'd rather do something like this:

..bar {
include .foo
}

If there's no solution I can just copy the contents of the foo class to
the bar class but then everytime I change foo I will have to change bar too.

StarQuake
--
for some how-to's and rpms visit my site : http://solid.bounceme.net
for commercially supported solutions visit : http://www.robas.com
Sep 20 '05 #3
StarQuake schreef:
'sNiek wrote:
StarQuake schreef:
For example:

I have two css files. One with the class foo and one with the class bar:

foo.css:
---------
.foo {
font-size : 12px;
}

bar.css:
---------
.bar {
some include function here
}

What I want is that the class bar becomes exactly the same as foo.

Thanks!

StarQuake


Just call it .foo and the styles it will overrule (or supplement) the
styles in the foo.css


Yes, that would be possible but the problem is I can't change the code
that refers to both foo.css and bar.css

So I'd rather do something like this:

.bar {
include .foo
}

If there's no solution I can just copy the contents of the foo class to
the bar class but then everytime I change foo I will have to change bar
too.

StarQuake


Another solution would be something like <p class="foo bar">
--
Niek
Sep 20 '05 #4
On Tue, 20 Sep 2005 10:56:08 +0200 in
comp.infosystems.www.authoring.stylesheets, StarQuake favored us
with...
So I'd rather do something like this:

.bar {
include .foo
}

If there's no solution I can just copy the contents of the foo class to
the bar class but then everytime I change foo I will have to change bar too.


This is an FAQ; the answer is "no way in CSS, but you can always
implement some sort of text preprocessing to build your CSS file."

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:

http://diveintomark.org/archives/200..._wont_help_you
Sep 20 '05 #5
StarQuake wrote:
For example:

I have two css files. One with the class foo and one with the class bar:

foo.css:
---------
.foo {
font-size : 12px;
}

bar.css:
---------
.bar {
some include function here
}

What I want is that the class bar becomes exactly the same as foo.


If you used only one css file you could do something like this:

..foo, .bar {
// Common properties
}
..foo {
// Different properties (foo only)
}
..bar {
// Different properties (bar only)
}
Sep 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Gandalf | last post by:
Hello. I thought that strlen was only available after adding #include <string> to my c++ program, but apperently not, or the compiler is clever enough to find it by it self, or what? The...
3
by: marsboee | last post by:
This must have been the MFC (or basic C++) class I slept through: I have a typedef in a header file (for a CView subclass). I want to use this type in another .h file. How do I make this type...
18
by: Exits Funnel | last post by:
Hello, I'm a little confused about where I should include header files and was wondering whether there was some convention. Imagine I've written a class foo and put the definition in foo.h and...
9
by: lkrubner | last post by:
How do I get all the div's on a page? I realize in IE I can use document.all. For the other browsers, I need to get an array of all the divs on the page. getElementByTagName()?????
7
by: MrNobody | last post by:
I was a Java developer so I'm used to using property files as a means to keep configuration settings for my apps. I'm wondering what options are there with ..NET? Some settings I want to include...
2
by: Max-Ph. Blickenstorfer | last post by:
I'd prefer to use C-Style #include directives to conditionally compile classes in c#. The code should look like #if (TEST) #include <..\inc\this.cs> #else #include <..\inc\that_one.cs>
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
6
by: star-italia | last post by:
Hi, Is it possible to include a XAML file into another XAML file? For example If i have - Window1.xaml - Window2.xaml and both have a treeview with a custom Style, can i describe the style...
2
by: Rodger | last post by:
All, I am looking to re-work my main page and have been using include statements on it and I now want to add another section, but this time my include is ASP. If I pull the ASP up by itself it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.