Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > include function in stylesheet

Reply
Thread Tools

include function in stylesheet

 
 
Edwin van der Vaart
Guest
Posts: n/a
 
      09-08-2008
Is it possible to use a php include function in a stylesheet?
--
Edwin van der Vaart
http://www.evandervaart.nl/ Edwin's persoonlijke web site
Explicitly no permission given to Forum4Designers, onlinemarketingtoday,
24help.info, issociate.de, velocityreviews, umailcampaign.com,
gthelp.com, webfrustration.com, excip.com and many other to duplicate
this post.
 
Reply With Quote
 
 
 
 
Gusero
Guest
Posts: n/a
 
      09-08-2008
Edwin van der Vaart wrote:

> Is it possible to use a php include function in a stylesheet?


No, but it would be so nice if this were possible!
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      09-08-2008
Edwin van der Vaart wrote:

> Is it possible to use a php include function in a stylesheet?


Technically, no, it would not be a stylesheet. Just as you can't use php in
html - but you can create a file that contains php commands and other
content so that when processed by a php processor, it produces an html file.
Similarly, if you can make your php processor handle a file containing php
commands and css content, it might produce a css stylesheet.

But why would specifically use an include command? After all, css itself
contains an include feature, an @import construct at the start of a css
stylesheet.

Yucca

 
Reply With Quote
 
Edwin van der Vaart
Guest
Posts: n/a
 
      09-08-2008
Ed Mullen wrote:
> Edwin van der Vaart wrote:
>> Is it possible to use a php include function in a stylesheet?

>
> No.
>
> What are you trying to accomplish?

I was trying to reduce the size of the file by removing some code from
e.g. style.css and place the code in an other file e.g. nav.css.

Stupid me.
css Is a styling thingy and not a code like C++, Java, PHP, etc.
That's why I can't use a php include function.

Thanx for the answer.
--
Edwin van der Vaart
http://www.evandervaart.nl/ Edwin's persoonlijke web site
Explicitly no permission given to Forum4Designers, onlinemarketingtoday,
24help.info, issociate.de, velocityreviews, umailcampaign.com,
gthelp.com, webfrustration.com, excip.com and many other to duplicate
this post.
 
Reply With Quote
 
Sherm Pendley
Guest
Posts: n/a
 
      09-08-2008
Edwin van der Vaart <> writes:

> Is it possible to use a php include function in a stylesheet?


I *highly* doubt that your server is configured to process .css files
with PHP. But, a .php file can output CSS text, images, or any other
media type you want it to output. All you have to do is use PHP's
header() function to set the correct Content-type.

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
 
Reply With Quote
 
Edwin van der Vaart
Guest
Posts: n/a
 
      09-08-2008
Jukka K. Korpela wrote:
> Edwin van der Vaart wrote:
>
>> Is it possible to use a php include function in a stylesheet?

>
> Technically, no, it would not be a stylesheet. Just as you can't use php
> in html - but you can create a file that contains php commands and other
> content so that when processed by a php processor, it produces an html
> file. Similarly, if you can make your php processor handle a file
> containing php commands and css content, it might produce a css stylesheet.


That does do the trick.
Make a php handler that produce css content.

> But why would specifically use an include command? After all, css itself
> contains an include feature, an @import construct at the start of a css
> stylesheet.

Thank you for the info, explanation and pointing to the @import construct.
--
Edwin van der Vaart
http://www.evandervaart.nl/ Edwin's persoonlijke web site
Explicitly no permission given to Forum4Designers, onlinemarketingtoday,
24help.info, issociate.de, velocityreviews, umailcampaign.com,
gthelp.com, webfrustration.com, excip.com and many other to duplicate
this post.
 
Reply With Quote
 
Sherm Pendley
Guest
Posts: n/a
 
      09-08-2008
Edwin van der Vaart <> writes:

> I was trying to reduce the size of the file by removing some code from
> e.g. style.css and place the code in an other file e.g. nav.css.


The common way to do that is to simply put multiple stylesheet links
in one's HTML.

> css Is a styling thingy and not a code like C++, Java, PHP, etc.
> That's why I can't use a php include function.


That doesn't make a bit of sense. The reason you can't put PHP code
in a .css file is that your server isn't configured to process .css
files with PHP. You can easily output CSS text, images, or any other
content type from a .php file though.

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
 
Reply With Quote
 
Edwin van der Vaart
Guest
Posts: n/a
 
      09-08-2008
Sherm Pendley wrote:
> Edwin van der Vaart <> writes:
>
>> Is it possible to use a php include function in a stylesheet?

>
> I *highly* doubt that your server is configured to process .css files
> with PHP. But, a .php file can output CSS text, images, or any other
> media type you want it to output. All you have to do is use PHP's
> header() function to set the correct Content-type.

Thank you for the info.
--
Edwin van der Vaart
http://www.evandervaart.nl/ Edwin's persoonlijke web site
Explicitly no permission given to Forum4Designers, onlinemarketingtoday,
24help.info, issociate.de, velocityreviews, umailcampaign.com,
gthelp.com, webfrustration.com, excip.com and many other to duplicate
this post.
 
Reply With Quote
 
Adrienne Boswell
Guest
Posts: n/a
 
      09-08-2008
Gazing into my crystal ball I observed Edwin van der Vaart
<> writing in news:b1611$48c5738c$d55d1d7e$17319
@news.chello.nl:

> Is it possible to use a php include function in a stylesheet?


As others have said, it is possible to create a PHP document on the server
and serve it as text/css, but, the only problem with this is that the
server has to compile the PHP document each time, which defeats the ability
for a browser to cache the stylesheet.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

 
Reply With Quote
 
Edwin van der Vaart
Guest
Posts: n/a
 
      09-08-2008
Sherm Pendley wrote:
> Edwin van der Vaart <> writes:
>
>> I was trying to reduce the size of the file by removing some code from
>> e.g. style.css and place the code in an other file e.g. nav.css.

>
> The common way to do that is to simply put multiple stylesheet links
> in one's HTML.
>
>> css Is a styling thingy and not a code like C++, Java, PHP, etc.
>> That's why I can't use a php include function.

>
> That doesn't make a bit of sense. The reason you can't put PHP code
> in a .css file is that your server isn't configured to process .css
> files with PHP. You can easily output CSS text, images, or any other
> content type from a .php file though.

Sorry, I said it wrong, but I know that php can give a content type as
an output.

Thanx for correcting me.
--
Edwin van der Vaart
http://www.evandervaart.nl/ Edwin's persoonlijke web site
Explicitly no permission given to Forum4Designers, onlinemarketingtoday,
24help.info, issociate.de, velocityreviews, umailcampaign.com,
gthelp.com, webfrustration.com, excip.com and many other to duplicate
this post.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/* #include <someyhing.h> */ => include it or do not include it?That is the question .... Andreas Bogenberger C Programming 3 02-22-2008 10:53 AM
Firefox and XSLT (local stylesheet works, server-based stylesheet fails) David Blickstein XML 14 10-15-2005 11:27 PM
xml:stylesheet use in document with multiple stylesheet options David Blickstein XML 3 08-02-2005 03:10 PM
have a stylesheet generate another stylesheet based on XML? Steven An XML 1 11-23-2004 01:07 PM
Stylesheet referanse i stylesheet =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?= XML 3 07-04-2004 03:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57