APD1993 Posted March 2, 2012 Share Posted March 2, 2012 ...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 Quote Link to comment https://forums.phpfreaks.com/topic/258099-is-there-a-way-that-a-css-stylesheet-in-one-folder-be-linked-to-php-scripts/ Share on other sites More sharing options...
Anon-e-mouse Posted March 2, 2012 Share Posted March 2, 2012 ...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. Quote Link to comment https://forums.phpfreaks.com/topic/258099-is-there-a-way-that-a-css-stylesheet-in-one-folder-be-linked-to-php-scripts/#findComment-1323051 Share on other sites More sharing options...
Muddy_Funster Posted March 2, 2012 Share Posted March 2, 2012 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>"; Quote Link to comment https://forums.phpfreaks.com/topic/258099-is-there-a-way-that-a-css-stylesheet-in-one-folder-be-linked-to-php-scripts/#findComment-1323054 Share on other sites More sharing options...
APD1993 Posted March 2, 2012 Author Share Posted March 2, 2012 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 :/ Quote Link to comment https://forums.phpfreaks.com/topic/258099-is-there-a-way-that-a-css-stylesheet-in-one-folder-be-linked-to-php-scripts/#findComment-1323058 Share on other sites More sharing options...
Muddy_Funster Posted March 2, 2012 Share Posted March 2, 2012 could you elaborate on that? Quote Link to comment https://forums.phpfreaks.com/topic/258099-is-there-a-way-that-a-css-stylesheet-in-one-folder-be-linked-to-php-scripts/#findComment-1323062 Share on other sites More sharing options...
APD1993 Posted March 2, 2012 Author Share Posted March 2, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/258099-is-there-a-way-that-a-css-stylesheet-in-one-folder-be-linked-to-php-scripts/#findComment-1323068 Share on other sites More sharing options...
Muddy_Funster Posted March 2, 2012 Share Posted March 2, 2012 did you change the file name to that of your actual stylesheet? do you actualy echo out body tags to the page being displayed? Quote Link to comment https://forums.phpfreaks.com/topic/258099-is-there-a-way-that-a-css-stylesheet-in-one-folder-be-linked-to-php-scripts/#findComment-1323081 Share on other sites More sharing options...
APD1993 Posted March 2, 2012 Author Share Posted March 2, 2012 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 :/ Quote Link to comment https://forums.phpfreaks.com/topic/258099-is-there-a-way-that-a-css-stylesheet-in-one-folder-be-linked-to-php-scripts/#findComment-1323115 Share on other sites More sharing options...
floridaflatlander Posted March 2, 2012 Share Posted March 2, 2012 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? Quote Link to comment https://forums.phpfreaks.com/topic/258099-is-there-a-way-that-a-css-stylesheet-in-one-folder-be-linked-to-php-scripts/#findComment-1323122 Share on other sites More sharing options...
APD1993 Posted March 2, 2012 Author Share Posted March 2, 2012 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! Quote Link to comment https://forums.phpfreaks.com/topic/258099-is-there-a-way-that-a-css-stylesheet-in-one-folder-be-linked-to-php-scripts/#findComment-1323149 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.