Tags

Element syntax

HTML elements are everything from the start (opening) tag and end (closing) tag

The tags start with < and end with >

The closing tag has / after <, e.g. </

<tagname>Content goes here...</tagname>

Never skip the closing tag

You can write html by omitting the closing tag but this may be interpreted wrongly in some browsers

Wrong

<p>Content goes here...
<div>Content goes here...
<section>Content goes here...

Correct

<p>Content goes here...</p>
<div>Content goes here...</div>
<section>Content goes here...</section>

Empty elements

Except that some elements don't have a closing tag

<br>
<hr>
<img src="meme.gif">
<input id="username">