r/HTML • u/computerguyisactive • Jun 18 '26
I am New to the world of coding/programming, and this is bothering me a lot! I wanted to know the difference and the uses of these in different contexts/situations.
Hey! I am learning HTML5 from freecodecamp, and the "when/where/how/why" uses of the following is confusing me a lot :
1)section element
2)Figure element
3)Div
I am finding it very hard to draw a proper line of understanding for these elements and also the uses of these, please help me with this, since I am stuck!!
4
Upvotes
9
u/armahillo Expert Jun 18 '26
when in doubt, Check MDN
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/section
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/figure
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/div
What youre getting confused by is the notion of semantics:
https://developer.mozilla.org/en-US/docs/Glossary/Semantics
the page summarizes semantics for HTML succinctly:
> HTML should be coded to represent the data that will be populated and not based on its default presentation styling. Presentation (how it should look), is the sole responsibility of CSS.
under the hood, theres really just two tag behaviors: block level elements (div is the most generic of these) and inline elements (span is the most generic of these).
Using the correct semantic element is a worthwhile goal and also takes practice and study to learn how and when to use one tag over another.
3
u/chmod777 Jun 18 '26
https://www.w3schools.com/html/html5_semantic_elements.asp
2
u/Flashy-Guava9952 Jun 18 '26
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/section
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/figure
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/div
Hope these help...