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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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! :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.