html - How do I use PHP to apply css properties? -


i want use php link css document's properties html would:

<link rel="stylesheet" href="mobile.css" type="text/css"> 

to specific, don't want import css file displays in between 2 css <style> tags in html. want php apply properties css document.

i want php able work in if statement:

<?php if ($mobile == true) { //your solution here } ?> 

thanks!

this you're asking for, isn't best practice , wouldn't recommend it. refer @nietonfir's suggestion (despite being little harsh, he/she right). doing mobile stuff in css part of responsive design (media queries) soooooo better , easier.

<?php if ($mobile == true){     echo '<link rel="stylesheet" href="mobile.css" type="text/css">'; } ?> 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -