Linking to an external style sheet

A

Anonymous

Guest
Hi guys, I am trying to link to a css file outside of a folder from a php file inside said folder and need some guidance as to how to do this. My code is:
Code:
<link rel="stylesheet" href="design.css" type="text/css" />
. Please help me out... :help:
 
Several options, depending on what you want. You can use . for the current directory, e.g. ./default.css, .. is the parent directory e.g. ../default.css. If you want to specify the complete path you can do that too using
Code:
$_SERVER['DOCUMENT_ROOT']/completepath/default.css
. You can also specify a complete url e.g.
Code:
http://www.php-forum.com/css/default.css
. If your page may move, a specified url or complete path is better. If not, a relative path (such as ../) is going to be quicker and simpler.
 
Back
Top