Centre align text that has extra letter spacing applied
alignment, css
Solution
Can't you just specify `padding-left: 1.5em;` for your `.container h5`?
Problem
What's the best way to centre align some text that has an increased `letter-spacing` so that it's actually in the centre of its container? The text is in an `h5` tag that is centre aligned within the parent `div` but sits noticeably to the left because `letter-spacing` applies to the right of each letter. I could manually add some left padding but that wouldn't stay consistently aligned if the browser zoom level was changed. Is there a way to calculate the spacing between each letter, either using css or JavaScript? Is there a better way to insert spacing between letters so everything is centrally aligned? The container div already has `20px` padding on all sides so I really need to add `0.75em` to the left padding. Here's the relevant css for the `h5` and container tags: ``` .container { padding: 20px; float: left; } .container h5 { font-size: 33px; letter-spacing: 1.5em; text-align: center; } ``` The container looks like this: