I am using PHP to determine if a user is on a mobile device or desktop browser. Right now I have the statement set to echo a "yes" or "no." Those are both functioning correctly. However, I want to add certain CSS code if the device is mobile and certain CSS code if it is not. Is this possible?
Here is an example:
$ismobile = check_user_agent('mobile');
if($ismobile) {
<div id="slider1">
Sample Text
</div>
} else {
<div id="slide2">
Sample Text 2
</div>
Thanks!
<link rel="stylesheet" href="...." />in the document head, using the same PHP if() structure.#slider1 { background-color: red; } #slide2 { background-color: blue; }??