w3c - Which has to be first on a HTML document Doctype or Comment? -
in proper html document, 1 should written first. either doctype or comment.
like
<!-- copyright (c) 2014 , pvt ltd. @file index.html --> <!doctype html>
or
<!doctype html> <!-- copyright (c) 2014 , pvt ltd. @file index.html -->
documents must consist of following parts, in given order:
- optionally, single "bom" (u+feff) character.
- any number of comments , space characters.
- a doctype.
- [...]
so shouldn't matter if write first doctype , comment, or viceversa.
however, html validator warns if use comment before doctype, ie go quirks mode. better use doctype first.
Comments
Post a Comment