Tutorials

KodeKite Tools

HTML
Flexbox
SVG
Canvas
HTML Tutorial

More


HTML Center Element
Center Element

Center is a formatting element set text centered align, centered text aligned at middle of document.

Syntax

<center>Content</center>

Or

<tag><center>Content</center></tag>


You can apply center element to any element and use any where within a HTML document.


Example

Centered text


Center is a pair tag and output of center element is centered text like you can see in above example.


Practice Task

Open notepad or any other text editor, follow the following points.


  • Write heading 4
  • Use <center> element to make it center

save file with name task.html or task.htm and then open it using any browser and see results.


Solution

Centered heading


Don't forget center is non empty element which means it always comes in pair.