Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (javk):

Can somebody help me with php? I have a css file and I would like to use those styles in the php code...is that possible?

OpenStudy (e.mccormick):

When you output web pages with PHP, you basically print the HTML to the web port. I see no reason why including CSS as yet more output would be a problem. A little research shows people doing a lot with it: http://stackoverflow.com/questions/13201451/how-to-use-css-style-in-php https://css-tricks.com/css-variables-with-php/ http://code.tutsplus.com/articles/supercharge-your-css-with-php-under-the-hood--net-6409

OpenStudy (woodrow73):

Wow that css embedded in a php page, and referenced by the html page with a <link rel="stylesheet" href="page.php" media="screen"> is really cool Nice examples

OpenStudy (woodrow73):

But ya.. looks pretty easy to put css in the file.. either using echo "//css" or simply ending the php tag ?>, then putting your html/css like you normally would - then you can place more php tags as you need them.. I think

OpenStudy (e.mccormick):

Yep. The issue is escaping things to have the right number of \ in there, and things like that, which is the sae issue with PHP to HTML.

OpenStudy (javk):

Thankyou, I got it. I'm working on a project and wasn't looking at all the files...it really was rather silly...I failed to look at the php file that contained the functions that defined what was going to be output to the html file.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!