Jump to content

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


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

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.