HTML <center> Center Tag
Tags: learnhtml, htmlc
Published: 2021-02-16 04:31:34

---
title: HTML <center> Center Tag
published: true
date: 2021-02-15 10:35:36 UTC
tags: LearnHTML,HTMLC
canonical_url: https://sharepointanchor.com/learn-html/html-center-tag/
---

The [HTML](https://sharepointanchor.com/learn-html/ "HTML") **center**  **Center tag** is used to **align the text to the center of the page**. It is a **block-level element** in [HTML](https://sharepointanchor.com/learn-html/ "HTML"). Instead of the center tag, you can use the **CSS text-align property**.

**Note** : The center tag is **deprecated in [HTML](https://sharepointanchor.com/learn-html/ "HTML")**, and **no longer available in HTML 5**.

<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 center tag contains both an **opening center tag** and **closing center tag**. The content is written between these two tags.

```

<center> Content </center>

```

## Sample of the HTML center Tag:

```

<!DOCTYPE html>
<html>
  <head>
    <title>Document title</title>
  </head>
  <body>
    <p>This is the normal text alignment for paragraph</p>
    centerThis text is move to the middle of the page.</center>
  </body>
</html>

```

## Result:

![](https://sharepointanchor.com/wp-content/uploads/2021/02/center-tag.png)<figcaption>Result</figcaption>

### Download Sample File:

[HTML-Center-tag](https://sharepointanchor.com/wp-content/uploads/2021/02/HTML-Center-tag.html)[Download](https://sharepointanchor.com/wp-content/uploads/2021/02/HTML-Center-tag.html)

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

## Use CSS property to Center the text.

```

<!DOCTYPE html>
<html>
  <head>
    <title>Document Title</title>
  </head>
  <body>
    <p>This is the normal text alignment for paragraph.</p>
    <p style="text-align:center">This content is move to the middle of the page</p>
  </body>
</html>

```

### Result:

![](https://sharepointanchor.com/wp-content/uploads/2021/02/Center-css.png)<figcaption>Result</figcaption>

## Styling Methods for center Tag:

You can use the following properties to style an [HTML](https://sharepointanchor.com/learn-html/ "HTML") center tag.

### Properties to style the visual weight/emphasis/size of the text in center tag:

- **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 center 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 center 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 center 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://sharepointanchor.com/wp-content/uploads/2021/02/Browser-Support-3.png)<figcaption>Browser Support</figcaption>

### Related Articles:

- **[HTML <big> Big Tag](https://sharepointanchor.com/learn-html/html-big-tag/)**
- **[HTML <aside> Aside Tag](https://sharepointanchor.com/learn-html/html-aside-tag/)**
- **[CSS align-items Property](https://sharepointanchor.com/learn-css/css-align-items-property/)**
- **[HTML <abbr> Abbreviation Tag](https://sharepointanchor.com/learn-html/html-abbreviation-tag/)**
- **[HTML <bdi> Bi-Directional Isolation Tag](https://sharepointanchor.com/learn-html/html-bdi-tag/)**

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