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

CSS Forum

    
How to detect version of CSS files?
toplisek




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

I like to set link to version of CSS file like:
styles.css?v=1.4"

How to do this in correct way?

 

JAB Creations




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

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

example.css

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

topr8




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

i do it differently like this:

styles.v1.4.css

toplisek




msg:4302096
 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




msg:4302353
 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...

<?php
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