NYCPHP Meetup

NYPHP.org

[nycphp-talk] Including CSS?

leam at reuel.net leam at reuel.net
Thu Jun 9 23:05:36 EDT 2005


I think this is the kicker--though I'd rather have the .css file not in the docroot I think the performance is a more desireable choice. Well, mostly. I'm just starting to use CSS and I'd rather figure it out now when there are only a couple requests per page instead of later.

Thanks!

leam

On Thu, Jun 09, 2005 at 01:45:06PM -0400, Dan Cech wrote:
> If you wish you can include a css file by putting something like
> 
> <style type="text/css">
> <?php include('styles.css');?>
> </style>
> 
> However, this will mean that the css data has to be sent on each and 
> every request.  By using the link syntax the styles fie will only be 
> fetched periodically assuming the client is using caching, and can also 
> be cached by proxy servers, which will increase the performance of the 
> site/application.
> 
> Dan
> 
> leam at reuel.net wrote:
> >The first way I saw to reference a CSS file was to have it in the <head> 
> >section, like this:
> >
> ><link rel="stylesheet" type="text/css" 
> >href="http://albasystemadmin.org/alba.css">
> >
> >But since i'm using include() on some files outside the docroot, is there 
> >a way to include the css file? Or does to have to be in the header?
> >
> >ciao!
> >
> >leam



More information about the talk mailing list