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

Linking Style Sheets

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 unfortunately restrictions on the architecture may
this unfeasible. With the LINK tag I could use that but I
understand older browsers dont support it properly.

I will only ever have 2 style sheets. Is there a way to link
one style sheet to another from within itself? For example
I have a master style sheet and if an alternate style sheet
is provided I would like to include the master first (as the default)
at the top in the source of the alternate style sheet. There may be some
funky way out there to do this but couldn't put my finger on
it.

Any suggestions would be appreciated.
Luke Bellamy
Jul 20 '05 #1
2 3932
Luke Bellamy pounced upon this pigeonhole and pronounced:
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 unfortunately restrictions on the architecture may
this unfeasible. With the LINK tag I could use that but I
understand older browsers dont support it properly.

I will only ever have 2 style sheets. Is there a way to link
one style sheet to another from within itself? For example
I have a master style sheet and if an alternate style sheet
is provided I would like to include the master first (as the default)
at the top in the source of the alternate style sheet. There may be some
funky way out there to do this but couldn't put my finger on
it.


Call first style sheet from <head>:
<style type="text/css" media="screen, projection">@import
"../style/mymain.css"; </style>

Then from within "mymain.css" :

/* ---------------- The Menu ----------------- */
@import "mymenu.css";
/* ---------------- The Menu ----------------- */

--
-bts
-This space intentionally left blank.
Jul 20 '05 #2
be**********@hotmail.com (Luke Bellamy) writes:
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 unfortunately restrictions on the architecture may
this unfeasible. With the LINK tag I could use that but I
understand older browsers dont support it properly.
@import will block NS4 and other old browsers, which is presumably
what you mean by 'restrictions on the architecture'.

<link rel="stylesheet" type="text/css" href="style1.css">
<link rel="stylesheet" type="text/css" href="style2.css">
<link rel="stylesheet" type="text/css" href="style3.css">

however seems to load all three properly in every browser I've tested,
including NS4 (not tried IE4 or IE3, which are the only other browsers
I'd imagine being old enough to have a problem with it).
I will only ever have 2 style sheets.
Well, for now...
Is there a way to link one style sheet to another from within
itself? For example I have a master style sheet and if an alternate
style sheet is provided I would like to include the master first (as
the default) at the top in the source of the alternate style
sheet. There may be some funky way out there to do this but couldn't
put my finger on it.


You could also use a preprocessor or similar.

--
Chris
Jul 20 '05 #3

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

Similar topics

16
by: Geoff Cox | last post by:
Hello, I publish some web pages using large fonts and would like to give the user the opportunity to print the pages using a smaller font. I believe that this is possible using different style...
3
by: Phil Thompson | last post by:
does it matter in which order i place different style sheets i.e. <link rel="stylesheet" type="text/css" media="screen" href="style/screen.css" /> <link rel="stylesheet" type="text/css"...
12
by: relaxedrob | last post by:
Hi All! I have a page with with the following style information: <link rel="stylesheet" type="text/css" href="/eEmployment/eTech.css" /> <style type="text/css"> DIV.Application {...
11
by: Safalra | last post by:
I've always linked to external stylesheets using a line like: <link rel="stylesheet" href="style.css" type="text/css"> I recently installed the HTMLTidy extension for Firefox and it objected...
12
by: Jarno Suni | last post by:
I want a device to use styles given for media type handheld and not the styles given for media type screen, if the device supports media types handheld and screen. Is it possible without writing...
9
by: Radium | last post by:
Cascading Style Sheet is an extreme hazard to your privacy. It allows others on the internet to see your monitor and files. It allows them to copy images on your monitor to their computers. It...
2
by: Hallvard B Furuseth | last post by:
Are there any guidelines or conventions for how to organize the preferred and alternate style sheets for a site, sheets for different media, and what titles to give them in the <link...
1
by: mscertified | last post by:
Can anyone explain how references to style sheets work, I've exhausted looking in help, its all so confusing. I have three style sheets in my project under 'Style Sheets'. Only the first style...
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...
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.