HighDots Forums  

Style sheet priority

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Style sheet priority in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andrew Bartle
 
Posts: n/a

Default Style sheet priority - 08-04-2004 , 10:48 PM






Hi there,

I have a web application that will be deployed for multiple clients. I
would like to have a set of styles that apply to the site that can be
overwritten for each specific client as required.

My proposed approach is to have two stylesheets: one containing all
the default styles, and the other containing those styles that I want
overwritten for the specific instance. This requires control over
which stylesheet takes priority. Can I do this with consistant results
across all mainstream browsers (i.e. by placing one link tag before
the other), or is there another approach that you would recommend?

Thank you very much for your time.

Cheers,
Andrew

Reply With Quote
  #2  
Old   
Gus Richter
 
Posts: n/a

Default Re: Style sheet priority - 08-05-2004 , 12:25 AM






Andrew Bartle wrote:

Quote:
Hi there,

I have a web application that will be deployed for multiple clients. I
would like to have a set of styles that apply to the site that can be
overwritten for each specific client as required.

My proposed approach is to have two stylesheets: one containing all
the default styles, and the other containing those styles that I want
overwritten for the specific instance. This requires control over
which stylesheet takes priority. Can I do this with consistant results
across all mainstream browsers (i.e. by placing one link tag before
the other), or is there another approach that you would recommend?

Thank you very much for your time.

Cheers,
Andrew
Don't forget to apply the same title attribute to both stylesheets and
the two stylesheets will combine as a preferred style.

--
Gus



Reply With Quote
  #3  
Old   
Paul
 
Posts: n/a

Default Re: Style sheet priority - 08-05-2004 , 12:41 AM



Andrew Bartle wrote:

Quote:
Hi there,

I have a web application that will be deployed for multiple clients. I
would like to have a set of styles that apply to the site that can be
overwritten for each specific client as required.

My proposed approach is to have two stylesheets: one containing all
the default styles, and the other containing those styles that I want
overwritten for the specific instance. This requires control over
which stylesheet takes priority. Can I do this with consistant results
across all mainstream browsers (i.e. by placing one link tag before
the other), or is there another approach that you would recommend?

I suggest linking to the specific stylesheet and importing the default
stylesheet into this by @import... If you link to two stylesheets for
the same medium type then the user should be given a choice of which
stylesheet to use - not really what you want.


Reply With Quote
  #4  
Old   
Stephen Poley
 
Posts: n/a

Default Re: Style sheet priority - 08-05-2004 , 09:33 AM



On 4 Aug 2004 20:48:09 -0700, andrewb (AT) iname (DOT) com (Andrew Bartle) wrote:

Quote:
I have a web application that will be deployed for multiple clients. I
would like to have a set of styles that apply to the site that can be
overwritten for each specific client as required.

My proposed approach is to have two stylesheets: one containing all
the default styles, and the other containing those styles that I want
overwritten for the specific instance. This requires control over
which stylesheet takes priority. Can I do this with consistant results
across all mainstream browsers (i.e. by placing one link tag before
the other), or is there another approach that you would recommend?
Make sure you're familiar with the cascading requirements:
http://www.w3.org/TR/1998/REC-CSS2-1...e.html#cascade
In particular the specificity rules sometimes trip people up.

Having said that, I don't recall any problems with a browser failing to
observe the requirement that the latter-specified rule wins.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/


Reply With Quote
  #5  
Old   
Andrew Bartle
 
Posts: n/a

Default Re: Style sheet priority - 08-08-2004 , 04:51 PM



Thank you all for your tips. It seems that a browser should prioritize
the styles in the latter specified stylesheet so I will give that a
go. A quick test with IE indicates that it works, but I need to test
it with the other important browsers. If it fails then I will find a
workaround based on your other ideas.

Cheers,
Andrew


Stephen Poley <sbpoleySpicedHamTrap (AT) xs4all (DOT) nl> wrote

Quote:
On 4 Aug 2004 20:48:09 -0700, andrewb (AT) iname (DOT) com (Andrew Bartle) wrote:

I have a web application that will be deployed for multiple clients. I
would like to have a set of styles that apply to the site that can be
overwritten for each specific client as required.

My proposed approach is to have two stylesheets: one containing all
the default styles, and the other containing those styles that I want
overwritten for the specific instance. This requires control over
which stylesheet takes priority. Can I do this with consistant results
across all mainstream browsers (i.e. by placing one link tag before
the other), or is there another approach that you would recommend?

Make sure you're familiar with the cascading requirements:
http://www.w3.org/TR/1998/REC-CSS2-1...e.html#cascade
In particular the specificity rules sometimes trip people up.

Having said that, I don't recall any problems with a browser failing to
observe the requirement that the latter-specified rule wins.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.