How do apply CSS to my PHP. A situation whereby you want to really create a dynamic squeeze page with Php by apply colors so on? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How do apply CSS to my PHP. A situation whereby you want to really create a dynamic squeeze page with Php by apply colors so on?

PHP

7th Oct 2017, 12:07 AM
Adejo Gabriel Onuche
Adejo Gabriel Onuche - avatar
4 Answers
+ 2
On the one hand, yeah -- I'd do what @Freezemage is saying -- and use PHP to just include the stylesheet instead of sending in a bunch of granular styles. On the other...do you mean "how to color code PHP", like if you were displaying PHP source code for someone to read? This is called "Syntax Highlighting" and there are so many different options here you might get a better answer faster (than my guess), from Google.
7th Oct 2017, 12:48 AM
Kirk Schafer
Kirk Schafer - avatar
+ 2
@Freezemage - yep... I've got one code from like 4 months ago that uses hilite.js, but not for PHP... and I think it parses the <code> tag ... so on both: works for me :)
7th Oct 2017, 1:21 AM
Kirk Schafer
Kirk Schafer - avatar
+ 1
CSS3 is applied to HTML code, not PHP. Even though you can apply CSS3 to PHP (by echo-ing the HTML/CSS code), but it's not recommended.
7th Oct 2017, 12:26 AM
Freezemage
Freezemage - avatar
+ 1
@Kirk For code highlighting <code></code> is enough, I think. Plus I have a link to site for custom syntax highlighting.
7th Oct 2017, 12:49 AM
Freezemage
Freezemage - avatar