HTML Void Elements


Void Elements & Break

All elements we have seen so far have this structure:

<start_tag> . . . </end_tag>

Some elements do not have any content, These are called 'void elements'.

They must not use an end tag.


There are 3 types of break, Which we use in the html

Handling breaks <br>,<wbr>,<hr>


A Void Element We Have Already Seen

<meta name="author" content="Daniel">

Void elements may or may not have attributes


Some Other Void Elements

Handling multimedia <img> - before

Handling forms <input> - later

Handling breaks <br>, <wbr>, <hr> - now


Breaks

<p> My favourite word is supercalifragilisticexpialidocious. It comes from the movie 'Mary Popins' and is hard to spell correctly. </p>

Code Output: My favourite word is supercalifragilisticexpialidocious. It comes from the movie 'Mary Popins' and is hard to spell correctly.


<p>My favourite word is supercalifragilisticexpialidocious. <br> It comes from the movie 'Mary Poppins' and is hard to spell correctly.</p>

Code Output: My favourite word is supercalifragilisticexpialidocious.
It comes from the movie 'Mary Poppins' and is hard to spell correctly.


<p>My favourite word is supercalifragilistic <wbr> expialidocious. It comes from the movie 'Mary Poppins' and is hard to spell correctly.</p>

Code Output: My favourite word is supercalifragilistic expialidocious. It comes from the movie 'Mary Poppins' and is hard to spell correctly.


<p>My favourite word is supercalifragilisticexpialidocious. <hr> It comes from the movie 'Mary' and is hard to spell correctly. </p>

Code Output: My favourite word is supercalifragilisticexpialidocious.


It comes from the movie 'Mary' and is hard to spell correctly.




Copyright © 2020. All rights reserved.