+ 2
What is semantic element in html and the examples?
Semantic elements
2 RĂ©ponses
+ 5
Vinome
Semantic Elements :
Semantic elements are elements which describes its purpose or usage.
Header , footer, nav, form, a, img, table etc are semantic elements. Because this elements itself describes its purpose.
Exaple : Header elements describes that it should be used as an header of the webpage and nav element is for navigation.
Non-semantic elements :
These elements purpose depends on the user or it just doesnât not have any default purpose like semantic elements.
Div, span etc are some non semantic elements.
Here div and span elements itself doesnât provide the details like semantic elements.
You can use this elements as you wish. Its up to you.
Examples of non-semantic elements: <div> and <span> - Tells nothing about its content.
Best guide..
https://www.w3schools.com/html/html5_semantic_elements.asp#:~:text=What%20are%20Semantic%20Elements%3F,%3E%20%2D%20Clearly%20defines%20its%20content.
+ 3
Semantic tags create meaningful and easy to read elements, Ex: we can creat a footer or header with div tag but with header and footer semantic tags it makes more sense.