+ 2
what's the difference between div & article tag and what is the benefit of using them in web page
difference between <div> and <article>
3 Antworten
+ 5
div is a general purpose wrapper
article is a semantic element
meaning putting your "articles" in that elements makes
1) your code more readable
2) search engines classify your page better
+ 4
The tag <article> is an one of the tags which is added to HTML specifications.
You can use either of them, but the <article>, <header>, <footer> and other HTML5 tags will give to your code more readability and probably useful/easy for search engines.
+ 3
https://developer.mozilla.org/en-US/docs/Web/HTML/Element
<ARTICLE>:
"The HTML <article> element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable (e.g., in syndication). Examples include: a forum post, a magazine or newspaper article, or a blog entry."
<DIV>:
"The HTML <div> element is the generic container for flow content and does not inherently represent anything. Use it to group elements for purposes such as styling (using the class or id attributes), marking a section of a document in a different language (using the lang attribute), and so on."