It is impossible to create a Web page without HTML. HTML houses your content and describes its meaning. In turn, Web browsers render HTML-encased content for users.
-
Text content
-
Reference to other file
-
Markup
Markup is essential, because it describes the content's meaning.
Everything above the <body> start tag is the instructional information.
-
Elements
'Elements' are the pieces themselves, i.e. a paragraph is an element, or a header is an element, even the body is an element. Most elements can contain other elements, as the body element would contain header elements, paragraph elements, in fact pretty much all of the visible elements of the DOM(Document Object Model, 文檔對象類型).
-
Tags
'Tags' are what we use to organize a text file (which is just a long string of characters) such that it represents a tree of elements that make up the HTML document. Tags are not the elements themselves, rather they're the bits of text you use to tell the computer where an element begins and ends.
?When you 'mark up' a document, you generally don't want those extra notes that are not really part of the text to be presented to the reader. HTML borrows a technique from another language, SGML, to provide an easy way for a computer to determine which parts are "Mark Up" and which parts are the content. By using '<' and '>' as a kind of parentheses, HTML can indicate the beginning and end of a tag, i.e. the presence of '<' tells the browser 'this next bit is markup, pay attention'.
?Whatever that tag (or 'open tag') does, it applies to the content following the tag. Unless you want that to be the entire rest of the document, you need to indicate when to stop using that tag and do something else, so '<' and '>' are again used. Since elements are typically nested within other elements, the browser needs to be able to distinguish between the end of the current tag or the beginning of a new tag (representing a nested element). This is done by adding a '/' right after the '<' to indicated that it's a 'close tag'.
?For example, the '<em>' tag is used for element that needs Emphasis. The '<' and '>' indicate that this is a tag, and the "little bits of text" in between tell us what kind of tag it is. To completely describe the element, it needs an open and close tag, with everything in between the tags is the contents of the element:
-
Attributes
-
body
-