ejaboneta Posted February 26, 2009 Share Posted February 26, 2009 I've been using php to include my css files. I decided to instead link them but when i do, the results aren't the same. Some things aren't working. For example, when i link it, if a tables width or height is set to 100%, it won't work. I even tried putting the height in the actual table but its not working there either. Some of the background colors aren't working as well. Is there a way to fix this or am I going to have to just include it like I have been? Quote Link to comment Share on other sites More sharing options...
dropfaith Posted February 26, 2009 Share Posted February 26, 2009 inline styles or external sheets should react the same either way so im not sure i grasp your issue can you post some code? Quote Link to comment Share on other sites More sharing options...
ejaboneta Posted February 27, 2009 Author Share Posted February 27, 2009 That's what I thought. I made a copy of my index file and named it index2. Its the same css file and the same page. External Stylesheet Internal Stylesheet Quote Link to comment Share on other sites More sharing options...
haku Posted February 27, 2009 Share Posted February 27, 2009 There are a number of problems. I'll touch on a couple: 1) You don't need <style> tags in the external sheet. They invalidate your code. 2) You have the <style> tags before your doctype on the page where it's internal. The style tags have to be between the <head> tags of your document, or they invalidate your code. In this particular case, because they are before your doctype, your doctype is being invalidated. The doctype has to be the absolute first thing in your HTML. It cannot have spaces, tabs, newlines, or any kind of text before it, or it is invalidated. This is most likely causing your problem, because without a doctype, the browser has no way of knowing what rules it should use to parse the HTML. And when you have any output before the doctype, it's the same as not having a doctype. Quote Link to comment 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.