homepage Welcome to WebmasterWorld Guest from 54.211.73.232
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
CSS in PHP
rikiki

5+ Year Member



 
Msg#: 3835181 posted 11:24 pm on Jan 26, 2009 (gmt 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

thanks

 

RonPK

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3835181 posted 11:39 am on Jan 27, 2009 (gmt 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.

jetboy

5+ Year Member



 
Msg#: 3835181 posted 8:19 pm on Jan 28, 2009 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved