On this page
  1. <center>
  2. Summary
  3. Notes & Best Practices
  4. Example

<center>

Prev: `<div>` | Up: text | Next: `<font>`
Rel: CSS display, text, Text & Lists Guide
Ref: MDN Web Docs — <center>
Tags: #public #web #html #elements #text #tier/legacy


Summary

Obsolete presentational element for horizontal centering.

Legacy / Avoid: Prefer CSS display in all new markup.

Notes & Best Practices

Example

<!-- Replace <center> with CSS -->
<div style="text-align: center;">Centered text</div>

Linked from

Related notes