HTML - elements

Foreword

HTML documents are defined by HTML elements.

HTML element

Start tag Label content End tag
<p> This is a paragraph </p>
<a href="defalut.html"> This is a link </a>
<br> Wrap  

Note: the start tag is often referred to as a start tag (opening tag), often called a closed end tag label (closing tag).

HTML element syntax

  • HTML elements start to start the label

  • HTML elements with an end tag termination

  • Content element is the content between the opening and closing tags

  • Some HTML elements have empty content (empty content)

  • Closed empty elements in the start tag (tag beginning to end and end)

  • Most HTML elements can have attributes

HTML empty element

HTML elements without content are called empty elements. Empty elements are closed in the start tag.

<br> is not closed empty element tag (<br> tag defines a line break).

In XHTML, XML, and future versions of HTML, all elements must be closed.

Adding a slash at the beginning of the label, such as <br />, is the proper way to close empty elements, HTML, XHTML and XML accept this way.

Even <br> it is valid in all browsers, but using <br /> actually more long-term protection.

HTML Tip: Use lowercase tags

HTML tags are not case sensitive: <P> is equivalent to <p>. Many sites use uppercase HTML tags.

We recommended to use lowercase tags because the World Wide Web Consortium (W3C) recommended the use of lowercase in HTML 4, the mandatory use of lower case and in future versions of HTML (X) in.

 

  Author: Jeremy.Wu
  Source: https://www.cnblogs.com/jeremywucnblog/
  This article belongs to the author and blog Park total, welcome to reprint, but without the author's consent declared by this section must be retained, and given the apparent position of the article page the original connection, otherwise the right to pursue legal responsibilities.

Guess you like

Origin www.cnblogs.com/jeremywucnblog/p/12083076.html