To include a css file to .php file.
Inside the .php file, We have;
[ad type=”banner”]We want it like this..
But obviously that doesn’t work. Is there any way to do this?
There are Four ways to solve this :
Solution 1 : echo a snippet.
Solution 1 : include/require
Solution 2: same as you normally do in a HTML file.
Solution 3:Consider your CSS file as a PHP file.
PHP is a server-side language,CSS is client-side and is used by the browser.
use echo :
Use include/require :
[ad type=”banner”]same as you normally do in a HTML file.
Consider your CSS file as a PHP file.
( instead of your_style.css, work with your_style.php )
Css file linking can be categorized in two ways :
By Html Code :
This is the traditional method for including CSS in your document.
It can be done by using link tag in head section of the document.
By Php Code :
This is by far new and powerful way to import css in a document.
But the only condition is you have to surround the php code with style element.
[ad type=”banner”]CSS files aren’t linked to PHP, they are linked to HTML.
PHP can generate a line of HTML that references a CSS file like this:
[ad type=”banner”]