...

View Full Version : converting html to php, css not read



iez
08-29-2011, 10:25 PM
Hi, I'm in the process of changing the html pages of my website into php. The problem I am having is when I change the .html to .php, the webbrowser stops applying the external css to the page. The external stylesheet is applied when it has the .html extension but not when I change it to .php.

The external stylesheet is in the header as:

<link rel="stylesheet" type="text/css" href="http://www.mysite.com/1/uti/main.css" />

How do I get the css to apply to the website once it is changed from .html to .php?

Thank you!

Fou-Lu
08-29-2011, 10:44 PM
.PHP doesn't break a CSS load. The problem will be your output HTML. For that you'll need to check the HTML source to ensure that the proper path has been placed in it.
Unless you mean that the .css has been converted to PHP (rare to do this), in which case you would load a .php file and best to push a header for a content type of text/css (although not really necessary).

iez
08-29-2011, 11:20 PM
Maybe you can tell me what I am doing wrong, as it seems only some of the css is translating.
[Links removed]

Fou-Lu
08-30-2011, 12:17 AM
We better take those links out as this is not an adult friendly website.

Check your source, you're PHP is repeating the starting <html> section twice in the code. The body itself is not repeated, but I'm willing to bet that'll be a large part of the problem.
The HTML you have in here is quite old as well. Use the validator at validator.w3.org to verify the HTML to doctype in use. There is also a css validator on their website to ensure that the CSS is also standards compliant.

dniwebdesign
08-30-2011, 03:48 AM
We better take those links out as this is not an adult friendly website.

Sorry for straying off topic but it's "not an adult friendly website"? So it's kid friendly? Or do you mean it's not "Family Friendly"? ;)

oracleguy
08-30-2011, 06:52 AM
Sorry for straying off topic but it's "not an adult friendly website"? So it's kid friendly? Or do you mean it's not "Family Friendly"? ;)
Yeah I was confused when I read that too. I guess Fou-Lu was blinded by his newly acquired 5 digit post count. :p

The links that were posted were to an adult orientated website. What I think Fou-Lu was trying to say was: Those kinds of links aren't allowed since CodingForums is a family friendly place. And we have some members that are young.

The OP can still get help though.

Fou-Lu
08-30-2011, 02:33 PM
Oops, I actually meant not an 'adult website friendly forum'. Lol. You got what I meant so its all good.

iez
08-30-2011, 10:32 PM
Thanks for the reply! Sorry for the links, I guess I wasn't thinking, sorry if I offended!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum