Muhammad Arif Muhammad Arif - 7 months ago 12
PHP Question

How to add css in php file?

Here is my php code:

if($_GET['cmd']=='7') {
reports();
bar();
$strXML=past7days();
}

and here is my HTML

<a id="default" href="#" style="color:#000; text-decoration:none"><? echo date('M dS Y' ,strtotime($startdate)); ?> to <? echo date('M dS Y' ,strtotime($enddate)); ?></a>


I want to add

#default{
color:#000;
text-decoration:none;
}


using php.

How i do this?

Answer

you create a file called css.css or whatever. put your #default styles in that file. and at top of this page add before opening the php brackets:

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