Search code examples
htmldoctypew3c

HTML Doctype changed?


Edit: My Problem was in the nginx.conf, I just added include mime.types; and now it works.
I recently noticed that my css doesn't work when I put <!DOCTYPE html> on top of my Document, but when I <!DOCTYPE> it works. Isn't the first the 'official' way? Also w3c validator gives me errors on second but accepts first one. Tested with Firefox and Chromium under Linux. Has anbody else noticed this behaviour?

My html

!DOCTYPE>
<html>
        <head>
                <meta charset="utf-8">
                <link href="css/style.css" type="text/css" rel="stylesheet">    
        </head>
        <body>

And my css

table {
        border: 1px solid black;
}

Solution

  • <!DOCTYPE html> is the only correct way to use HTML5. You will need to provide code to troubleshoot further.