Jump to content

Is there a way that a CSS stylesheet in one folder be linked to PHP scripts...


APD1993

Recommended Posts

...in a different folder?

 

For instance, I have a stylesheet in my  C:\xampp\htdocs\rcm folder, and I want to link it to files in the C:\xampp\htdocs\ folder. Is there a way of doing this?

 

Thanks in advance :)

 

Have a shared header file? So that whatever file you apply the header to will have that same CSS sheet?

 

Thats how I would personally action that.

just use the path in the header:

echo "<head><title>You should always have a title in the header</title><link rel=\"stylesheet\" type=\"text/css\" href=\"rcf/stylesheet.css\"></head>";

 

That didn't see to work for me :/

could you elaborate  on that?

 

For my stylesheet, I set the background colour of the body to red, and when I used the code you gave above, the background of the webpage that I linked the stylesheet to did not change to red

did you change the file name to that of your actual stylesheet?

 

do you actualy echo out body tags to the page being displayed?

 

The name of my style sheet file is stylesheet.css and I am still having difficulties :/

The answer to your questions is yes, depending on the category(url aka get statement) I call different css scripts.

Are you sure you have your file paths right?

Are you sure your style actually effects the web page?

 

If they're correct the code Muddy_Funster gave you will work. (I like single quotes)

echo '<head>

<title>You should always have a title in the header</title>

<link rel="stylesheet" type="text/css" href="rcm/stylesheet.css">

</head>';

 

The code Muddy_Funster had had "rcf/stylesheet.css", you didn't check that? Again is the path correct, are there any typos here? Are you sure the css effects the page?

 

The answer to your questions is yes, depending on the category(url aka get statement) I call different css scripts.

Are you sure you have your file paths right?

Are you sure your style actually effects the web page?

 

If they're correct the code Muddy_Funster gave you will work. (I like single quotes)

echo '<head>

<title>You should always have a title in the header</title>

<link rel="stylesheet" type="text/css" href="rcm/stylesheet.css">

</head>';

 

The code Muddy_Funster had had "rcf/stylesheet.css", you didn't check that? Again is the path correct, are there any typos here? Are you sure the css effects the page?

 

I use single quotes, and that seemed to do the job :). Thanks for everyone's help! :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.