What is DOCTYPE and how is it important?
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:
<!doctype html>
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.
What is the use of data- attribute?
Attributes prefixed by data-
solely used to store information or embedding private data.
Highlight text in HTML
Use HTML5 tag mark
.
Do JS/CSS files downloaded in order of occurring?
No. CSS/JS files can be downloaded in parallel if they are referenced in head
element.
But interpretation of them performed with respect to their order.
Standards mode vs quirks mode
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.
What's the difference between HTML and XHTML?
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.