Note that there are some explanatory texts on larger screens.

plurals
  1. POmake a css file create on the fly and dynamicly
    text
    copied!<p>There are many situations when you have to create a css file dynamically.<br> For example you may want to change the font family to something base on the parameter in the request</p> <p>You can make the css build dynamically base on a parameter pass to it, and make a css file to a dynamic asp, jsp, php ...</p> <p>For example in java:</p> <pre><code>&lt;link href="MainCss.jsp?param=someFont" type="text/css" rel="stylesheet"&gt; </code></pre> <p>Then is the MainCss.jsp</p> <pre><code>body { font-size:100%; background:#fff; &lt;%if ( request.getParameter("param") == "someFon" )%&gt; font-family:"Tahoma"; &lt;%else%&gt; font-family:"Verdana"; } </code></pre> <p>I have been told that there are many disadvantages in this solution:</p> <ul> <li>It does not allow caching of the CSS files on the server and client</li> <li>It makes it more difficult to understand and maintain the pages</li> <li>Each time your server will serves a CSS page, it will have to run a few tens of thousands of additional CPU cycles, compared to having the CSS files as purestatic documents. </li> </ul> <p>They suggestion seems to be acceptable!</p> <p>But, I keep looking around the web and find many sites which somehow do something like above: ebay.com:</p> <pre><code>&lt;link href="http://gh.ebaystatic.com/header/css/all.min?combo=11&amp;ds=3&amp;siteid=0" type="text/css" rel="stylesheet"&gt; </code></pre> <p>wikipedia.org</p> <pre><code>&lt;link rel="stylesheet" href="//bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&amp;amp;lang=en&amp;amp;modules=ext.gad" /&gt; </code></pre> <p>They have told me that these site also use pure css and the <code>load.php?debuge=false</code>... is only a css file selector and will select a pure css file from harddisk and send it to the client.</p> <p>Is this technique correct? Has any one had any experience with my problem?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload