homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

How to detect version of CSS files?

 7:43 am on Apr 21, 2011 (gmt 0)

I like to set link to version of CSS file like:

How to do this in correct way?


JAB Creations

 5:02 pm on Apr 21, 2011 (gmt 0)

You would use a server side scripting language, best to use PHP.


body {font-size: 20px;}
echo '/* '.$_GET['v'].' */';
div.left {float: left;}


 7:05 pm on Apr 21, 2011 (gmt 0)

i do it differently like this:



 7:13 pm on Apr 21, 2011 (gmt 0)

I'm new to this
<link rel="stylesheet" href="css/stylesheet1.css?v=1.4" type="text/css" />

How is correct echo for this in php pages where is this css link.

JAB Creations

 6:35 am on Apr 22, 2011 (gmt 0)

Top, those are HTTP queries. In example...

<link href="example.css?query1=1&query2=2&widgit=3" />

In PHP you can echo those as...

if (isset($_GET['query1'])) {echo $_GET['query1'];}
if (isset($_GET['query2'])) {echo $_GET['query2'];}
if (isset($_GET['widgit'])) {echo $_GET['widgit'];}

Always check to see if something isset() otherwise you'll spawn errors...and if you expect something and it does not exist it can throw a wrench in your gears so-to-speak.

- John

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved