Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   
   HTML   
   CSS   
   JAVA SCRIPT   
   JQUERY   




HTML - Article Tag


The article tag or <article> tag in HTML is used to define a content that is independent of other contents in a webpage.


Why do we need Article Tag in HTML?


So far we have used <div> tags to represent self contained articles in HTML. However, with Semantic tags, we got the article tag that defines a a self dependent content for a webpage. The Article Tag usually contains a heading and a paragraph and is independent of the other contents.


What does the Article Tag contain?


The article tag usually contains a news article, blog posts, online forum posts e.t.c.


Let us understand article tag with the below example.


Example :



<html>
<body>
	<article>
		<h1>First Paragraph</h1>
    	<p>This is the first paragraph</p>
    </article>	
</body>
</html>


Output :




So, if you look at the above code. The article tag represents an article in the HTML page. For simplicity we have written arbitrary texts inside the article tag.


<article>
	<h1>First Paragraph</h1>
	<p>This is the first paragraph</p>
</article>

Now, the article tag is not just restricted to one article tag in a webpage. In simple words we can have multiple article tags in an HTML file.


Using multiple section tags in an HTML page


Example :



<html>
<body>		
	<article>
		<h1>First Paragraph</h1>
    	<p>This is the first paragraph</p>
    </article>
    	
	<article>			
		<h1>Second Paragraph</h1>
    	<p>This is the second paragraph</p>
    </article>	
</body>
</html>


Output :