Introduction
The ‘<center>
‘ element was used in older versions of HTML to define a block of content that should be centered horizontally within its containing element. It was typically used to center-align text or other inline or block-level elements.
However, the ‘<center>
‘ element has been deprecated in HTML5, and its usage is discouraged. Modern web development encourages the use of CSS for styling and layout purposes.
Here is an example :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<center>
Hello World
</center>
</body>
</html>
Output :
But today we use CSS for centering the text.