View Full Version : more than one CSS ?
augean
06-01-2003, 02:11 PM
hi
I would know can we have more than one CSS file , like I have two CSS files for my website and I want to use both of them in all pages of that.
can I use any INCLUDE statement to include one CSS to another one then I dont need to do anything else :)
any help or idea is appreciated
~Augean
Frank
06-01-2003, 10:14 PM
I'm a bit confused on what you mean by two style sheets and wanting to use both of them. Do you mean you want to have more than one style sheet and use them to apply different themes? if that is the case, then yes you can have more than one style sheet on your site, but I believe that you can only use one at a time in a page. I could be wrong about that as I don't really know a whole lot about CSS. I believe that you can use ASP to determine which style sheet to load but I'm not completely sure how to go about it as I've not tried that yet.
Here are a few tutorials on style sheets at HTMLGoodies (http://www.htmlgoodies.com/beyond/css.html)
As far as including a style sheet into another style sheet, I don't know if that can be done or not. As far as I know most people put all of their style definitions in one single sheet and include that into their pages.
HTH!
Frank
augean
06-02-2003, 04:23 AM
Hi
thank you for answers ,
here is the deal , I have website that is made by me and my friend. now I have one file like style1.css and he had another one like style2.css .
and I want these 2 parts of site work good without editing any more than this ,
I'm looking for something like INCLUDE statement that we use at HTML , then I can have one file like Default_syle.css and include those 2 other css files.
Thank you
~Augean
freejoe76
06-03-2003, 07:45 PM
try using:
<link rel="stylesheet" type="text/css" href="basic01.css">
<link rel="stylesheet" type="text/css" href="basic02.css">
in the heads of your page . . . however, why not just cut and paste one's contents into the other?
augean
06-04-2003, 03:22 AM
Hi
as I said I didn't want to copy nad paste them to one , but I did it and now I have just one css file
Thank you guys for all infos
~Augean
web4all
10-26-2004, 05:43 AM
sorry, I'm confused...
where's the deal for using more stylesheet files onto the same html on the same time ?
Matthew Bonner
12-27-2004, 03:29 AM
Maintenance, style swapping maybe or even possibly different media rules.
Refer to http://www.w3.org/TR/2003/WD-css3-syntax-20030813/#at-import
FlyingDutchman
10-08-2006, 10:29 PM
sorry, I'm confused...
where's the deal for using more stylesheet files onto the same html on the same time ?
I also had some slight problems with having just one style-sheet.
I changed my header and suddenly one of my pages had troubles with my style-sheet. It positioned my other content [buttons a.o.] far too high.
So, what I did, was to eliminate that part from my original style-sheet and named it eather : standard_insert.css or indo-craft_insert.css.
I added that file into my html page, like freejoe76 said 06-04-2003 01:45 AM :
<link rel="stylesheet" type="text/css" href="original.css">
<link rel="stylesheet" type="text/css" href="standard_insert.css">
or
<link rel="stylesheet" type="text/css" href="original.css">
<link rel="stylesheet" type="text/css" href="indo-craft_insert.css">
depending on the page.
This way you can manage different pages, still using a standard.css and a different one for certain different positions.
I just seem to have some problem switching the different browsers :wacko: and at this very moment I'm still struggling.
_______________________________________________
Update 1 : I solved the "problem" by adjusting some positions :D
_______________________________________________
Update 2 : http://Pramanik.Indo-Craft.com, http://www.Indo-Craft.com and http://Bunga.Indo-Craft.com are worth vistiting ! ... :whistle:
I solved the problems of cross-browser and screensetting, still keeping [almost] ONE css file [the other I still gotto implement :D]. See my post further on.
Archangel
10-09-2006, 10:35 AM
One thing to always make sure when doing this is that you don't have ANY classes or ID's or anything named the same in either style sheet b/c this will cause issues as one will be overwritten.
FlyingDutchman
10-18-2006, 07:11 AM
One thing to always make sure when doing this is that you don't have ANY classes or ID's or anything named the same in either style sheet b/c this will cause issues as one will be overwritten.
:) I still have all classes the same name. But ... to be able to become cross browser and cross screensetting, I had to put an 'extra' style-code into my HTML pages, still keeping a class in my CSS-file. So ... into my Indo-Craft.css :
CSS [example] :
.Indo-Craft {position: relative;
z-index:3;
margin-left:16%;
}
And into my HTML [example] :
<div style="position:relative;z-index:3;left:-1%;top:8px" class="Indo-Craft">
<script type="text/javascript"><!-- <p> Indonesian Handycrafts, Fine Arts, Antiques ... </p>
//--></script>
</div>
Be prepared to do some positioning ... but it worked for me ! :D
FlyingDutchman
10-18-2006, 09:52 AM
P.S. - I put "that code" in every HTML unchanged. Problems ? Tell me, please.
Matthew Bonner
12-03-2007, 08:46 AM
Here are another few reasons why you should separate your stylesheets:
Sharing some CSS with many pages can be done by including snippets in different stylesheets.
You can even use a stylesheet created by somebody else, provide their credits and then in another stylesheet, override some of their CSS rules with your own and provide your own credits.
If you have problems when you split your styles then there are issues with inheritance and overriding, you should carefully choose the order in which you include each CSS element and think about using the !important declaration.
Cleverly designed CSS files are small and easy to apply site-wide changes.
You should also consider using Eric Meyer's CSS reset stylesheet as your first stylesheet then creating your own as the second stylesheet.
If you take a look at the big boys, I have yet to see any not split up their stylesheets, this clearly indicates that in most cases you are best with many CSS stylesheets opposed to one when developing a website. If your website ever stops being developed, then it will most likely become obsolete so if you ever say your website is finished think again!
vBulletin v3.0.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.