473,396 Members | 2,013 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,396 software developers and data experts.

Style sheet priority

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
Jul 20 '05 #1
5 6380
Andrew Bartle wrote:
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

Jul 20 '05 #2
Andrew Bartle wrote:
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.
Jul 20 '05 #3
I can't really see a way around this except for some server-side scripting
to dish out the relevant stylesheet according to the customer login. If you
were thinking of dishing out stylesheets to customers based on their
language, you could use content negotiation to have the web server
automatically send the stylesheet that matches the languages the customer's
browser can accept.
Jul 20 '05 #4
On 4 Aug 2004 20:48:09 -0700, an*****@iname.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.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #5
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 <sb******************@xs4all.nl> wrote in message news:<tv********************************@4ax.com>. ..
On 4 Aug 2004 20:48:09 -0700, an*****@iname.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.

Jul 20 '05 #6

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

Similar topics

2
by: Mark | last post by:
Hi - I want to allow users of an intranet application, to select their own colours etc. So I have a tbale in my database, which has fields called bgcolour, fontcolour etc. As I want all pages...
2
by: Luke Bellamy | last post by:
Hi, I have been looking for a way to incorperate several different style sheets into a web page (i.e cascading effect). I have looked into the @import statement which seems to do what I want but...
98
by: Pamel | last post by:
I know this must have been asked elsewhere, but I cannot find it. There is a piece of text on my web page that I don't want browsers to resize. IE won't resize it if I specify the size in px, but...
8
by: pamelafluente | last post by:
Hi guys, Is it possible to add "onload" (via Javascript) a new class to the <styleheader section? If yes, how would that be done ? <style type="text/css" media="screen"> .NewStyleClass{...
10
by: pamelafluente | last post by:
Hi, this time I am trying to add a style on the fly.I wish equivalency with this one (only the menuItemStyle line): <head> <style type="text/css" media="screen"> ... some static styles ......
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a machine running IIS 6.0. I just replaced the web.config and several aspx pages in the application and now the style sheets are not working. the images from the themes work but not the css...
3
by: Mark B | last post by:
Is there one or somewhere I can download a gallery of professionally designed templates?
4
by: fjm | last post by:
Hello everyone. I’d like to know how to handle multiple style sheets. I have css tabs that have a style sheet and then I also have a separate style sheet for the content that goes inside the tab. ...
4
Frinavale
by: Frinavale | last post by:
So a while ago I created a Tab Strip Control (before the AjaxToolkit had theirs otherwise I would have probably just used theirs). When I looked at the AjaxToolkit control to see how they got...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.