HTML DOCTYPE file type declaration
In the first line at the very beginning of the HTML file, be sure to write this DOCTYPE:
<!DOCTYPE html>
In essence not a DOCTYPE HTML tags, DOCTYPE declaration of intention is used to tell the browser (browser) This document is the file type (Document Type Declaration, DTD) belong, DOCTYPE modern web pages are basically used <!DOCTYPE html>
to represent this It is a standard HTML5 document.
Failure to declare a DOCTYPE or declare a wrong DOCTYPE will cause unexpected behavior of the browser, such as rendering CSS layouts that are different from what you want, which is called the browser in Quirks mode. ) Next.
By the way, I will also introduce some common DOCTYPEs in the old age. You may also see these wordings on some web pages:
HTML 4.01 Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML 4.01 Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
XHTML 1.0 Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
XHTML 1.0 Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
XHTML 1.0 Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
XHTML 1.1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Post a Comment
0 Comments