Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies


11:24 pm on Jan 26, 2009 (gmt 0)

New User

10+ Year Member

joined:Jan 26, 2009
posts: 1
votes: 0

hi all, I have built a page in HTML and have attached a CSS to it and have been able to preview it in different browsers and it appears to be working perfectly.

but when I tried to run it through XAMPP the result is not even remotely similar. my background images don't appear, nothing is centered as it should and basically all of my CSS formatting is just gone.

can anyone please explain to me what I need to do in order to run an HTML page with some CSS formatting through a PHP server? I've been told I only need to change the extension from .html to .php but that's not working. i'm new to PHP so I could really use some help


11:39 am on Jan 27, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 22, 2002
votes: 0

Perhaps the web server doesn't send the right content-type header along with the stylesheet. Some browsers ignore the stylesheet if it doesn't have the right content-type. You can easily check the header with the Web Developer Toolbar for Firefox.
8:19 pm on Jan 28, 2009 (gmt 0)

Full Member

10+ Year Member

joined:Feb 14, 2005
posts: 266
votes: 0

As RonPK said. Particularly if you have PHP parsing enabled for .css files. If you have, adding:

<?php Header ("Content-type: text/css"); ?>

at the top of your .css file/s will fix it.

Either that or your external files links are referencing your local hard drive, which is an easy mistake to make if you're using something like Dreamweaver.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members