Jump to content

Css In Php


Chikwado
 Share

Recommended Posts

Some one help explain this: Is it possible to wrapp css property in php. Example:

<?php                                      header('Content-Type: text/css');   .box{font-weight:bold;}
Then may be you can include it in head section. Although I have not hear these story before. But I have seen something that look like that in Phpmyadmin. Edited by Chikwado
Link to comment
Share on other sites

No, it's not possible to put CSS inside PHP blocks. You can put it outside of them, though. You can write CSS in PHP the same way you write HTML code in PHP:

<?php
header('Content-Type: text/css');
$color = '#ED0000';
?>

.error {
  border: 1px solid <?php echo $color; ?>
  color: <?php echo $color; ?>;
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...