The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Adding a DOCTYPE killed my PHP Variable CSS

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #28457

    I am presently working on a website for which I had declared no DOCTYPE. Of course it was impossible to validate the HTML without a DOCTYPE, so I added one (HTML 4.01 Transitional). The HTML now validates and the CSS validates as CSS2.1. However, before adding the DOCTYPE the site worked across all the browsers I tested (IE8, Firefox, Chrome, Safari) and now it only works for IE. All other browsers completely ignore the CSS.

    Does anyone have any ideas?

    Here is the original page without a DOCTYPE:

    Here is the identical page except for the addition of a DOCTYPE:


    Rob MacKay

    you are calling your stylesheet in as a PHP file – so I am guessing you want to use variables or something in your CSS?

    If you have done this you need to make sure you set your headers in your style.css



    If not it wont know what to do with the file.


    Rob, you were correct on all accounts. I am using variables inside my CSS and adding the header to the style sheet has corrected all the problems. Thank you, sir, for your help in my hour of confusion.


Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.