system — 2009-05-13T20:40:14-04:00 — #1
Can you add CSS to PHP code ? I have a bunch of PHP code within one PHP file but I want to stylize them individually, only thing each PHP code has <h1> and <p> tags. I suppose there is no way each <h1> tag can be stylized different if all this can even be done?
co_ador — 2009-05-13T21:02:51-04:00 — #2
You can create a .css file that contains all this <h1> <h2> and other tags you have in your php code and then add it to the php file and it will pull in all the data in the css and style your php code.
Just add the fallowing line to the top of your php file.
<link type="text/css" href="../stylesheets/whateverfile.css" rel="stylesheet" media="all" />
and it will pull in all the data to the php file you have.
oddz — 2009-05-13T21:04:31-04:00 — #3
The only practical way is to use an embedded style sheet or inline styles. Then just output the appropriate style information to the page. I normally use embedded styles in the head rarely inline.
ivy_league_web — 2009-05-13T21:37:08-04:00 — #4
php files are the same as html files, except you can also add php code in places
system — 2009-05-14T10:13:24-04:00 — #5
Oh, alright it seems simple enough. I will do just that then !
system — 2014-10-07T20:51:45-04:00 — #6
This topic is now closed. New replies are no longer allowed.