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 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. 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>"; 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 :/ 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? 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 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? 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 :/ 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? 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! 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
Archived
This topic is now archived and is closed to further replies.