What if we don't close a tag? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What if we don't close a tag?

If we don't close the tag, would it works, or the browser is going to give errors?

1st Apr 2019, 5:21 AM
Wahid Khudayar
Wahid Khudayar - avatar
1 Answer
+ 2
Tags like <br> <IMG> <hr> <li> , etc doesn't need an end tag But tags like <head> <html> <body> <p> <ol> <ul> , etc needs an end tag Not writing an end tag would not bring an error but it would not show the content inside that tag So, it's better to follow the rules😎
1st Apr 2019, 7:39 AM
Poorva Mahesh Shukla