Add a style.css onto a php file

jdunhin

New member
Joined
Feb 27, 2013
Messages
93
Points
0
Add a style.css onto a php file.

PHP:
<?php
echo '<style type="text/css">';
include 'style.css';
echo '</style>';
?>
 

hoangvu

New member
Joined
Jun 6, 2012
Messages
1,879
Points
0
Good information to add style css into php.
I can rewrite It will be easy to understand for viewers
PHP:
<?php 
$css = '<link rel="stylesheet" type="text/css" href="style.css" />';
echo $css; // export to where you want to include style on your page
?>
That's my suggestion :)
 

shophia

New member
Joined
Mar 25, 2013
Messages
46
Points
0
It’s all depends on the directory formation you've set up. If a stylesheet.css is in the similar directory as header.php, you'll need to include this:

Code:
echo "<link rel='stylesheet' type='text/css' href='stylesheet.css' />";
If you have every of your exterior CSS in a directory under header.php, you'll need to include this:
Code:
echo "<link rel='stylesheet' type='text/css' href='css/stylesheet.css' />";
And last if you have your CSS file in a folder over header.php, you'll need to include this:
Code:
echo "<link rel='stylesheet' type='text/css' href='../stylesheet.css' />";
 
Last edited by a moderator:
Older threads
Replies
11
Views
3,316
Replies
22
Views
12,283
Replies
0
Views
1,843
Replies
27
Views
10,184
Replies
11
Views
3,871
Latest threads
Replies
2
Views
36
Replies
1
Views
19
Replies
0
Views
19
Replies
3
Views
25
Recommended threads
Replies
5
Views
3,525
Replies
2
Views
859
Replies
0
Views
2,812
Replies
0
Views
527

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Latest Blog ArticlesMost Viewed Threads

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top