|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
CSS -- Internal vs External -- Speedwise
Is there any difference in speed for an internal style sheet vs an external one?
I've putting all the styles withing each page dynamicly from one source, because of themes and the want to change some styles from one place only it has to be done. Is there is a better way then internal style? With external there is the plus of having it cached, and I could have the style.css be parsed by php instead, would this be better?
__________________
Miscellaneous Software Viper_SB Developershed E-Support Anyone else play chess? Challenge me |
|
#2
|
||||
|
||||
|
absolutely no difference whatsoever - providing the external CSS file is on your machine.
if you use external CSS then it is loaded and then the page is formatted. If you use internal the CSS is loaded with the page. Either way you have the same amount of CSS code. Loading the external file in may add a millisecond or two. A big point of CSS is that it should really be used with external sheets, otherwise its kind of defeated, fair enough you would have more control with CSS than font tags but you would still have to go into every page and change them if internal. |
|
#3
|
||||
|
||||
|
ya but each page is dynamic php all going to be read mostlikly from a db so everything will be changed from one place (but is just weird
) anways thanks for the input. |
|
#4
|
||||
|
||||
|
im not getting what you are doing? why are you putting CSS definitions in a database? Just use external CSS files and then call then with LINK REL=stylefile.css .......
|
|
#5
|
||||
|
||||
|
apologies if I have totally the wrong end of the stick
![]() |
|
#6
|
||||
|
||||
|
Quote:
Agreed. some ppl say that the externals would be faster because the are only loaded once and then they are there. but even if they werent i would stillll stick with the externals...it makes it soooo much more flexible and easier and faster (in the design time sense) and it just makes for a good time. haha serisously...the time difference isnt calculable and the advantages of externall exceed internal by sooooo much its only worth doin it once...use external. ROCK ON!! ![]() |
|
#7
|
||||
|
||||
|
well I would (and have on other sites) used external ones, let me try to explain what needs to be done.
There are themes, say 5 of them (there can be unlimited), within each theme is 3 stylesheets, large medium and small. To make a single change across multiple themes you'd need to edit 15 css files (say the a class(tag) which isn't affected by size) this is something the manager of the site doesn't want to have to do, he wants to edit the a tag in one spot and it affect all the themes. Hope it's explained better if not just say so. |
|
#8
|
||||
|
||||
|
read other post
![]() |
|
#9
|
||||
|
||||
|
are your pages dynamic? (php/asp?) you could just do:
$themeTypeSize = $_GET['themeTypeSize']; <link href="<?=themeTypeSize?>.css" rel="stylesheet" type="text/css"> But putting CSS files into a database just is not a good idea from any way I look at it. |
|
#10
|
||||
|
||||
|
aah - I see what you mean. What you should be doing is having a generic.css and then a themefile.css - every page should load generic.css and then the themefile.css can be dynamic - either called through cookie (if the users theme is saved), or just through the querystring etc.
|
|
#11
|
||||
|
||||
|
how can you add the second css? I mean can you do.
<link href="generic.css" rel="stylesheet" type="text/css"> <link href="theme1.css" rel="stylesheet" type="text/css"> ? |
|
#12
|
||||
|
||||
|
yes, you can include as many css files as you want. They are just like server side includes
![]() |
|
#13
|
||||
|
||||
|
you did not say if your pages were html? or a server side language such as asp/php?
if the latter I would recommend making the theme style file name a variable and then calling that file with something like: <link href="<?=themeTypeSize?>.css" rel="stylesheet" type="text/css"> but its up to you - im off to be now so wont be replying for the next 10 hours or so sorry. |
|
#14
|
||||
|