HTML Elements

HTML Elements
 
The HTML element is everything from the start tag to the end tag:
<tagname>Content goes here...</tagname>

Examples of some HTML elements:

<h1>My First Heading</h1>
<p>My first paragraph.</p>
Never Skip the End Tag

Some HTML elements will display correctly, even if you forget the end tag:

 <!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>
  
</body>
</html> 
Notes:
However, never rely on this! Unexpected results and errors may occur if you forget the end tag! 
Empty HTML Elements

HTML elements with no content are called empty elements.

The <br> tag defines a line break, and is an empty element without a closing tag:

 <p>This is a <br> paragraph with a line break.</p> 

HTML is Not Case Sensitive

HTML tags are not case sensitive: <P> means the same as <p>.

 

 
 

No comments:

Post a Comment