HTML <article> Article Tag
Tags: learnhtml
Published: 2021-02-13 06:59:14

---
title: HTML <article> Article Tag
published: true
date: 2021-02-10 10:04:20 UTC
tags: LearnHTML
canonical_url: https://sharepointanchor.com/learn-html/html-article-tag/
---

The <article> tag represents an **independent self-contained content in an [HTML](https://sharepointanchor.com/category/learn-html/ "HTML") document**. The  **article tag** is one of the **new sectioning elements in HTML 5**.

An article should have its **own meaning and easily differentiated from the other web page contents**. In simple words, the HTML <article> tag is used to represent an article.

## A potential sources for <article>element:

- **Blog post**
- **Forum post**
- **Newspaper article**
- **User-submitted Comment**

On a page with a single piece of content, it requires a single <article> tag. But on a page with multiple contents such as **index page** , **search result page** , **category page** , there are **multiple <article> elements that** should be used.

<svg aria-hidden="true" focusable="false" data-icon="clock" width="20" height="20" fill="none" stroke="currentColor" style="display:inline-block;vertical-align:-0.1em" role="img" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>Estimated reading time: 3 minutes

## Syntax:

The <article> tag contains both an **opening <article> tag** and **closing </article> tag**. The content is written between these two tags.

## Sample of the HTML <article> Tag:

```

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <article>
      <h1>This is the title of the document</h1>
      <p>This is the sample paragraph</p>
    </article>
  </body>
</html>

```

## Result:

![](https://eadn-wc04-3430828.nxedge.io/cdn/wp-content/uploads/2021/02/Result-6.png)<figcaption>Result</figcaption>

<script async src="//jsfiddle.net/Share_Point_Anchor/qpv451Lw/embed/html,result/"></script>

## <article> Tag Styling Methods:

The <article> tag supports the **global attributes** and the **event attributes**. You can use the following properties to style an [HTML](https://sharepointanchor.com/category/learn-html/ "HTML") article tag.

### Properties to style the visual weight/emphasis/size of the text in <article> tag:

- **[CSS](https://sharepointanchor.com/category/learn-css/ "CSS") font-style** – This CSS property helps to set the font style of the text such as normal, italic, oblique, initial, inherit.
- **CSS font-family** – This CSS property specifies a prioritized list of one or more font family names or generic family names for the selected element.
- **CSS font-size** – This CSS property will help to set the size of the font.
- **CSS font-weight** – This CSS property used to define whether the font should be bold or thick.
- **CSS text-transform** – This CSS property will control the text case and capitalization.
- **CSS test-decoration** – This CSS property specifies the decoration added to text such as **text-decoration-line** , **text-decoration-color** , **text-decoration- style**.

### Styles to coloring the text in <article> Tag:

- **CSS color** – This CSS property will specify the color of the text content and decorations.
- **CSS background-color** – This CSS property helps to set the background color of an element.

### Text layout styles for <article> Tag:

- **CSS text-indent** – This CSS property is used to specify the indentation of the first line in a text block.
- **CSS text-overflow ** – This CSS property helps to describe how overflowed content that is not displayed should be signaled to the user.
- **CSS white-space** – This CSS property describes how white-space inside an element is handled.
- **CSS word-break**  – This CSS property decides where the lines should be broken.

### Other Properties for <article> Tag:

- **CSS text-shadow**  – This CSS property helps to add the shadow to text.
- **CSS text-align-last**  – This CSS property will set the alignment of the last line of the text.
- **CSS line-height** – This CSS property defines the height of a line.
- **CSS letter-spacing** – This CSS property helps to decide the spaces between letters/characters in a text.
- **CSS word-spacing** – This CSS property specifies the spacing between every word.

## Browser Support:

![](https://eadn-wc04-3430828.nxedge.io/cdn/wp-content/uploads/2021/02/Browser-Support-3.png)<figcaption>Browser Support</figcaption>

### Related Articles:

- [HTML <abbr> Abbreviation Tag](https://sharepointanchor.com/learn-html/html-abbreviation-tag/)
- [HTML <address> Address Tag](https://sharepointanchor.com/learn-html/html-address-tag/)
- [HTML<a> Anchor Tag](https://sharepointanchor.com/learn-html/html-anchor-tag/)

The post [HTML <code><article></code> Article Tag](https://sharepointanchor.com/learn-html/html-article-tag/) appeared first on [Share Point Anchor](https://sharepointanchor.com).