c-o-d-e Posted November 19, 2009 Share Posted November 19, 2009 I have two CSS Files needed for some pages <link href="styles/twoColLiqRtHdr.css" rel="stylesheet" type="text/css" /> <link href="styles/style.css" rel="stylesheet" type="text/css" /> twoColLiqRtHdr.css works fine, but style.css doesn't actually.. work. It looks like XAMPP can only use 1 css file. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/182164-solved-two-css-files-on-xampp-server/ Share on other sites More sharing options...
premiso Posted November 19, 2009 Share Posted November 19, 2009 XAMPP does not have anything to do with CSS working (unless the apache server settings on how to handle css are messed up, which I doubt cause you would of had to mess them up). Chances are the file is not at the specified location... HTML gets parsed by the browser, not the server. Now if the file is not at http://yourserver/styles/style.css then it will not work. Check to make sure that the style sheet is in that folder and not somewhere else. Quote Link to comment https://forums.phpfreaks.com/topic/182164-solved-two-css-files-on-xampp-server/#findComment-961115 Share on other sites More sharing options...
c-o-d-e Posted November 19, 2009 Author Share Posted November 19, 2009 The problem is though.. I can access the CSS here.. http://localhost/styles/style.css It works on here too.. www.developers-community.com/styles/style.css Quote Link to comment https://forums.phpfreaks.com/topic/182164-solved-two-css-files-on-xampp-server/#findComment-961121 Share on other sites More sharing options...
premiso Posted November 19, 2009 Share Posted November 19, 2009 The problem is though.. I can access the CSS here.. http://localhost/styles/style.css Why is that a problem? Basically what that means is that either you are viewing a cached version of your site or somewhere in your code something is messing up. Either in styles.css or twoColLiqRtHdr.css possibly have some issues on their own, or even in the file displaying those css styles has an issue. Given that the first style sheet works, my bet is on that you have an issue in your CSS code that is preventing the other stylesheet to display properly. Perhaps try validating your CSS pages via: http://jigsaw.w3.org/css-validator/ to make sure your sheets are valid and there are no fatal errors in them? It is really hard to tell just from that, the known fact is, it is not XAMPP causing the problem It is somewhere in the code/stylesheets/html. Quote Link to comment https://forums.phpfreaks.com/topic/182164-solved-two-css-files-on-xampp-server/#findComment-961122 Share on other sites More sharing options...
FaT3oYCG Posted November 19, 2009 Share Posted November 19, 2009 yeah but which folder is the script file that contains the link in. seen as you can work from site root for that try changeing it to this: <link href="/styles/style.css" rel="stylesheet" type="text/css" /> but we really need to know where you have placed the script that your html is contained in so that we know what the path should be in relation. p.s. the styles might be being overided. Quote Link to comment https://forums.phpfreaks.com/topic/182164-solved-two-css-files-on-xampp-server/#findComment-961125 Share on other sites More sharing options...
premiso Posted November 19, 2009 Share Posted November 19, 2009 yeah but which folder is the script file that contains the link in. Yea, I completely missed that part =\ It sucks taking time off from helping lol. Thanks for pointing that out as well. Quote Link to comment https://forums.phpfreaks.com/topic/182164-solved-two-css-files-on-xampp-server/#findComment-961128 Share on other sites More sharing options...
c-o-d-e Posted November 19, 2009 Author Share Posted November 19, 2009 I checked CSS Validator, and it comes up as: Congratulations! No Error Found. All the pages except CSS are found - C:\xampp\htdocs And for CSS - C:\xampp\htdocs\styles Exactly as it is on the production server - Which works I tried it as "/styles/style.css" which never worked either. Any other possibilities? What sensitivities are there in XAMPP. EG: <? and <?= aren't recognised in XAMPP. What about for div's who use a style sheet. If I have <div class="whatever" id="table"> And <div class="style" id="table"> Would that be overided? Quote Link to comment https://forums.phpfreaks.com/topic/182164-solved-two-css-files-on-xampp-server/#findComment-961141 Share on other sites More sharing options...
premiso Posted November 19, 2009 Share Posted November 19, 2009 Any other possibilities? What sensitivities are there in XAMPP. EG: <? and <?= aren't recognised in XAMPP. That is not recognized by XAMPP because of how XAMPP configures PHP, you can easily make those allowable by modifying the PHP.ini file, that is a php configuration. As far as div's / styles etc. The web server does not care about that, that is all HTML markup which is done on the client side not server side. Now the reference to the .css files do matter, try writing in the full absolute path to the style sheets and see if they work. As far as the overriding, if style.css has the same styles called as the prior sheet it will take precedent over them since it was last to be executed (I believe that is how it goes). The chances are the issue lies within your html code / location of files on the server. Post your current HTML for the page you are trying to style that is not working so we can look at what might be causing the issue. Alternatively, if you are using FireFox you can use the Developer tool to see errors with Javascript and some errors with CSS that maybe happening. (I believe it is located under Tools > Error Console) You may have to clear it out then refresh the page. Quote Link to comment https://forums.phpfreaks.com/topic/182164-solved-two-css-files-on-xampp-server/#findComment-961158 Share on other sites More sharing options...
c-o-d-e Posted November 19, 2009 Author Share Posted November 19, 2009 Ok, thanks for explaining I checked where the problem was in the website file which uses <? include 'mcommands.php' ?> Which mcommands was where it uses the style.css I changed it to <?php .. I couldn't believe this was the problem considering I found out this was a problem on another thread. Thanks for trying to help. Quote Link to comment https://forums.phpfreaks.com/topic/182164-solved-two-css-files-on-xampp-server/#findComment-961171 Share on other sites More sharing options...
premiso Posted November 19, 2009 Share Posted November 19, 2009 .. I couldn't believe this was the problem considering I found out this was a problem on another thread. Which is why posting some code would have saved some headache. I would suggest it for the next problem as it helps us to see where the real problem is instead of going on wild tangents that have nothing to do with the original problem. Just an idea! Quote Link to comment https://forums.phpfreaks.com/topic/182164-solved-two-css-files-on-xampp-server/#findComment-961173 Share on other sites More sharing options...
c-o-d-e Posted November 19, 2009 Author Share Posted November 19, 2009 Ok, I will do. Thanks ! Quote Link to comment https://forums.phpfreaks.com/topic/182164-solved-two-css-files-on-xampp-server/#findComment-961181 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.