Today talk is going about CSS / HTML / HTML 5 related questions on interview.
DOCTYPE considered deprecated way for embedding into XML documents. It supposed to point to DTD
document definition. In other words it names document type. Nowadays XML namespaces is in use.
Because HTML is not an XML and have SGML as ancestor as legacy it has
DOCTYPE declaration which
helps identify HTML version and mode (strict or transitional).
Since HTML 5 is living standard without profiles there is no need to carry version or mode
information and it was decided to reduce
DOCTYPE declaration simply to:
as a marker of HTML5 ready document.
Compare with old HTML4.01 declarations:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
Of course none is able to memorize such syntax. That is the reason for today syntax simplicity.
Attributes prefixed by
data- solely used to store information or embedding private data.
Use HTML5 tag
No. CSS/JS files can be downloaded in parallel if they are referenced in
But interpretation of them performed with respect to their order.
Quirks mode is a way to interpret HTML document in a way that is done by Navigator 4 and Internet Explorer 5 before web standards were established.
In standards mode rendering engine will follow W3C specifications.
HTML is less strict on document syntax. For example some tags can be without following closing tag.
XHTML is HTML in a form that compatible with XML syntax.