Why are some tags self-closing but others are not?


#1

Question

Why are some tags self-closing (img, br, etc.) whereas others are not?

Answer

The important distinction between self-closing tags and all other tags is that self-closing tags represent void elements. Void elements like img and br cannot contain any content. All other tags may (but are not required to) contain content.


FAQ: Learn HTML Elements - Intro to HTML - Videos
#2

What does the abbreviation ‘src’ stand for?


#3

It stands for “Source”, as in the location in which the file is located. In this situation the local or web address in which the image is located.


#4

img and br cannot contain any content,
we can see"A field of yellow sunflowers"in No.14, It’s content!


#5

Content is defined I believe on the second slide of this section as “information between the opening and closing tag.” This does not include attributes (like alt) which are solely defined within the opening tag!