<center>
center Tag
The <center>
HTML element is a block-level element that centers its content, whether block-level or inline, within its parent element.
Syntax
<center>Centered Text or Content</center>
center
Demo
So will this paragraph.
<center>
This text will be centered.
<p>So will this paragraph.</p>
</center>
DOM Interface
This element implements the HTMLElement
interface.
See Also
- text-align
- display
Conclusion
The <center>
element was once commonly used to center content horizontally, but it is now deprecated. Modern web development practices recommend using CSS for centering, as it provides greater flexibility and control. Using CSS ensures better accessibility, compatibility, and maintainability. Instead of <center>
, use text-align: center
for inline elements or wrap content in a <div>
and apply margin: 0 auto
for centering block elements.
<br>
The HTML <br> element creates a line break in text, making the following content begin on a new line without adding extra vertical space.
<cite>
The <cite> element in HTML is used to reference the title of a work, such as books, articles, movies, or artworks. By default, most browsers render <cite> text in italics to indicate citation.