Do all HTML elements have end tags? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Do all HTML elements have end tags?

Digging deep into HTML elements most people ignore simple basics that end up messing their codes.

12th Mar 2017, 9:22 PM
RoyEugene
RoyEugene - avatar
9 Answers
+ 5
no, not all .. there are so called "void elements" like : <area> <br> <img> <link> <meta> but notice that you need an ending slash if you are writing in XHTML. so for example in XHTML you must use <br /> instead of <br> !
12th Mar 2017, 10:17 PM
Albert Kunz
Albert Kunz - avatar
+ 5
markup language use tags to define functions but i m not sure whether you need it every time
13th Mar 2017, 11:56 AM
shobhit
shobhit - avatar
+ 3
Yeah.. Not all elements have end tags
27th Mar 2017, 6:03 AM
RoyEugene
RoyEugene - avatar
+ 2
Not all of them - IMG for example does not. HTML5 made the structure of the document easier to understand, but you are right, most of the stuff out there is a mess.
12th Mar 2017, 9:29 PM
spotbot2k
spotbot2k - avatar
+ 2
No. In any markup language tags are classified into two types: i)container tags: Which have opening and closing tags and also supports other tags within them. eg: <p>, <head>, <body> etc. ii)empty tags: The tags which don't have or support any other tags. eg. <br>,<img> etc
14th Mar 2017, 5:40 PM
Sidhanth_Mekala
Sidhanth_Mekala - avatar
+ 2
Not all
17th Mar 2017, 7:11 AM
Brian Odhiambo
Brian Odhiambo - avatar
0
No. Some has but not all others.
16th Mar 2017, 8:30 AM
Atiqa Ijaz Khan
Atiqa Ijaz Khan - avatar
0
No not all
24th Mar 2017, 7:34 AM
Vidhi Kedia
Vidhi Kedia - avatar
0
Not all,,but most have
16th Apr 2017, 5:42 AM
EVANS KIPTARUS KIBET
EVANS KIPTARUS KIBET - avatar