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. Link to comment https://forums.phpfreaks.com/topic/246411-how-to-link-a-stylesheet-with-php/ 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. Link to comment https://forums.phpfreaks.com/topic/246411-how-to-link-a-stylesheet-with-php/#findComment-1265339 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). Link to comment https://forums.phpfreaks.com/topic/246411-how-to-link-a-stylesheet-with-php/#findComment-1265340 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. Link to comment https://forums.phpfreaks.com/topic/246411-how-to-link-a-stylesheet-with-php/#findComment-1265346 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 Link to comment https://forums.phpfreaks.com/topic/246411-how-to-link-a-stylesheet-with-php/#findComment-1265349 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 Link to comment https://forums.phpfreaks.com/topic/246411-how-to-link-a-stylesheet-with-php/#findComment-1265393 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.