The use of <div>, <section>, and <article> tags on webpages. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

The use of <div>, <section>, and <article> tags on webpages.

Hi, I have some doubts. I'm making a webpage to practice the contents from the HTML course. I just want to understand if nowadays is the <div> tag still used to add content or is it the <section> and <article> tags that are being used? Is it good if I make use of all of them? For example, have some <div> tags for general content, like paragraphs of information. And <section> and <article> for comments or anything related to their respective use. When should I use <div> tags? Or should I avoid using them? I kind of get lost in this topic.

20th Nov 2018, 12:08 AM
Luis Escoto
Luis Escoto - avatar
3 Answers
+ 3
the thing about semantic tags are sometimes it's easier to read by the search engine (and anyone else who work with you), it'll know excactly what certain element does and contain and decide if its matter. So use it when you feel its right. For div, i usually use it for more broad thing that doesnt fit in article, section etc. But i use it alot for js and/or css purpose, because i kinda used to it.
20th Nov 2018, 12:32 AM
Taste
Taste - avatar
+ 2
Use only <div class="className" id="idName"> so that you can do styling in CSS and call the DOM in Javascript. You can drop C++ for now because it does not have a cohort effect with your HTML. after HTML, do CSS, after CSS, do Javascript, Do more test with the try it yourself in each lesson.
20th Nov 2018, 2:43 PM
Gordon
Gordon - avatar
0
Thank you for explaining Taste and Gordon. Now I understand better this topic.
20th Nov 2018, 5:31 PM
Luis Escoto
Luis Escoto - avatar