davery Posted September 4, 2011 Share Posted September 4, 2011 Hi, I wanted to know how to link a stylesheet using php specifically for the purpose of loading a different stylesheet when the home page displays. I heard of echoing out the stylesheet but I do not know how. Any help would be appreciated. Quote Link to comment Share on other sites More sharing options...
flappy_warbucks Posted September 4, 2011 Share Posted September 4, 2011 Hi, I wanted to know how to link a stylesheet using php specifically for the purpose of loading a different stylesheet when the home page displays. Is that a different stylesheet based on Browser, or a random stylesheet to mix things up a tad? Both will require a different approach. Quote Link to comment Share on other sites More sharing options...
davery Posted September 4, 2011 Author Share Posted September 4, 2011 Its a random to move an element down only on the homepage (sidebar). Quote Link to comment Share on other sites More sharing options...
flappy_warbucks Posted September 4, 2011 Share Posted September 4, 2011 $styles = array("stylesheet1.css","stylesheet2.css","stylesheet3.css"); echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $styles[rand(0,sizeof($styles)-1)]. "\" />"; // you minus 1 die to the cound being three, but the element count only going up to two. Quote Link to comment Share on other sites More sharing options...
davery Posted September 4, 2011 Author Share Posted September 4, 2011 I'm sorry forgive my limited knowledge of php, I'm actually still a novice. Could you perhaps explain a little of what I'm supposed to modify. thnx Quote Link to comment Share on other sites More sharing options...
voip03 Posted September 4, 2011 Share Posted September 4, 2011 It will help ypu. http://htmlhelp.com/reference/css/style-html.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.