Lea Verou 3/24/2013

Easily center text vertically, with SVG!

Read Original

This article presents an alternative method for vertically centering text using SVG's `text-anchor` and `dominant-baseline` properties. It compares this technique to common CSS methods, lists its drawbacks (like extra markup and limited text wrapping), and highlights advantages such as no parent element changes and good browser support including IE9+.

Easily center text vertically, with SVG!

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

1
ServiceNow and Microsoft Copilot
Marius Sandbu 1 votes
2
The Learning Loop and LLMs
Martin Fowler 1 votes