+ 7

Difference between article tag and div tag?

html tags

5th Mar 2018, 2:42 PM
developer 👩‍💻
developer 👩‍💻 - avatar
5 Antworten
+ 2
FreeCodeCamp has an excellent discussion on this topic: Wrap Content in the article article is another one of the new HTML5 elements that add semantic meaning to your markup. article is a sectioning element and is used to wrap independent, self-contained content. The tag works well with blog entries, forum posts, or news articles. Determining whether content can stand alone is usually a judgment call, but you can use a couple of simple tests. Ask yourself if you removed all surrounding context, would that content still make sense? Similarly, for text, would the content hold up if it were in an RSS feed? Remember that folks using assistive technologies rely on organized, semantically meaningful markup to better understand your work. Note: The section element is also new with HTML5, and has a slightly different semantic meaning than article. An article is for standalone content, and a section is for grouping thematically related content. They can be used within each other, as needed. For example, if a book is the article, then each chapter is a section. When there's no relationship between groups of content, then use a div. <div> - groups content <section> - groups related content <article> - groups independent, self-contained content
11th Apr 2021, 7:36 PM
EO4Wellness
EO4Wellness - avatar
+ 20
The <div> tag defines a division or a section in an HTML document. The <div> tag is used to group block-elements to format them with CSS. https://www.w3schools.com/TAGS/tag_div.asp https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div The <article> tag specifies independent, self-contained content. An article should make sense on its own and it should be possible to distribute it independently from the rest of the site. https://www.w3schools.com/TAGS/tag_article.asp https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article
5th Mar 2018, 2:59 PM
NezhnyjVampir
+ 6
The differences are only semantic, they work the same. You should use the article tag when the content alone makes sense. A clear example of this is a web article (a blog, a news page, etc), an RSS reader, the content of a comment, etc. Keep in mind also that some search engines like Google take into account the semantic elements introduced in HTML5, so your website can be penalized in the positioning (if it is published) if you do not use the corresponding tags.
5th Mar 2018, 3:09 PM
Mickel
Mickel - avatar
+ 1
but before answering the question tell me the difference between the independent countries and the countries which are divided and then independent themselves? you will thinking why i am asking you this question? if you got the meaning of the both then the difference between div and the article tags is similar to the question's content. now i hope u got it div -division between the cell of the rows and columns and then independent themselves article means completely independent or free without any (particular) divisions hope i am going right! inform me if its correct or not! and tell me too if its helpful for you or not? thanks for giving your time :) bye
26th Aug 2020, 4:31 PM
Sunita Zirange
Sunita Zirange - avatar
0
Sunita Zirange Hi. Your example is good. But currently is it better to use article instead of div in general? Since it is a new version of div?
21st Feb 2021, 9:16 PM
Maxim Cherkasov
Maxim Cherkasov - avatar