+ 5

Wich is better between div and article?

Im curious about which is better to use cause i see a lot of people still using the "div", even if they are using html5

28th Jul 2019, 4:00 PM
DokiMoeKyun
DokiMoeKyun - avatar
7 Respostas
+ 43
Nothing is better or worse in general, when you are comparing two different things. Which is better a keyboard or a pen? Of course that depends on the situation and your needs. Semantic HTML 5 elements have their specific use purposes. They are meant to improve the user experience, readability of code and functionality of other software like search engines, Ebook readers and text-to-speech apps. That means you should use them according to the conventions. Hence mind their location on the page and content inside them. A div, on the other hand, is generic block level element. It's a container for grouping other content or even creating shapes. A box you can style and turn it into anything you want. With div elements you are restricted where and how to use them. Heck, you can be more creative. Think of div tags as of simple boxes. You can put anything you want inside them. Well, imagine new elements are special boxes: lunchboxes, toolboxes, first aid kits. Mixing them would be horrible. Happy coding!
29th Jul 2019, 2:26 PM
🇺🇦 Drake CDR 🇺🇦
🇺🇦 Drake CDR 🇺🇦 - avatar
+ 38
One more tip. You can use @ symbol to mention other users in case they don't follow your question or post like so: Sonic.
29th Jul 2019, 2:34 PM
🇺🇦 Drake CDR 🇺🇦
🇺🇦 Drake CDR 🇺🇦 - avatar
+ 5
div is older and more general.
29th Jul 2019, 1:45 AM
Sonic
Sonic - avatar
+ 2
I try not to use a div, I can give classes to tags or pseudo-classes and use sections. Of course there are moments where it is impossible without divs. There is such a disease in divotitis developers))) Russian joke
28th Jul 2019, 4:15 PM
Anna/Аня
Anna/Аня - avatar
+ 1
Hi there Anna, sorry but can u give me an example of "where it is impossible without divs" please
28th Jul 2019, 4:22 PM
DokiMoeKyun
DokiMoeKyun - avatar
+ 1
Clearfix is ​​done with divas so that the reflex blocks do not stick to the head of the site. When you make a sprite and insert it into place under the div, and your pseudo-classes are occupied on this block.
28th Jul 2019, 4:25 PM
Anna/Аня
Anna/Аня - avatar
0
Blocks are blocks, the work exactly the same way.
30th Jul 2019, 8:43 PM
Fortunato Maycotte
Fortunato Maycotte - avatar