preface
In my last post, “Teach yourself the Front End, Part 1: Know HTML and what it means and how it’s written,” I got it a little wrong. HTML tags, not just pairs of tags, but also single tags. For example, the newline tag
Structure analysis
The structure of HTML is roughly divided into four parts. 1. Declaration document
2. HTML tag for < HTML >
3. Head tag for 4.
Photo source @ Luye Learning network
– Declaration document
This declaration says that this is an HTML page
– HTML tag pairs
This tag tells the browser where the HTML starts and ends.
– The head label is correct
This tag pair is the “header” tag of a web page, used to mark specific content. For example, titles, descriptions, keywords, etc
– The body tag is correct
This is the tag pair, the “body” part of the web page that contains style information.
Writing practice
<! DOCTYPE HTML > < HTML > <head> <title> </head> <body> <h1> </h1> <p>Copy the code
It is important to remember that the head tag should contain other tags, otherwise the output content is in the body elevation; The body tag pair also contains style tags, such as headings, paragraphs, etc., otherwise there would be no style.
Browser F12 to view the page just written, correct. The header header tag is hidden, and the page content header paragraph is displayed.