Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call one .css from another

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
GB
Hi all

Newbie type question so please be gentle. [smile]

Is it possible to call one .css from another and would that be preferable to having two .css called from the same document?

TIA

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Yes it's possible.
I don't think it's preferable one way or the other.

Personally, for clarity, I would call them via HTML link tags.


You can use the following within your CSS though if you wish

Code:
@import url("otherstyles.css");

Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Depends on which one you want to take precedence. If 2 sheets reference the same item, the later one overwrites the earlier.

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
As Johnwm says. It depends on what you're doing since you must consider the "cascade" whereby rules will be appended/overwritten.

Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
johnwm, foamcow

Thanks for your replies.

The content of each .css would be entirely different, covering different elements of the documents.

The main one would be generic and static, ie fonts, styles etc.

The secondary one would be built on the fly together with its relevant HTML documents by a user interacting with a database application running on a local machine.

Once the new HTML pages and new secondary .css file had been programatically built and checked by the user, they would be uploaded to the website by FTP, overwriting redundant server side documents.

The question really concerns any performance gain there might be from either method.

Hope that explains the perhaps peculiar question. [smile]

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top