It looks like this might be more to do with the font than the styling. As you said, the <> are a few pixels higher than the rest of the text. This is the case in some fonts but not others – for example the monospace font used here on stackoverflow has them in the same line on my screen. You might have better results changing the font to a mono one, using something like:
in your css file.
You may also find this better suits the aesthetic of your website, if I’m reading the context cues in your styling correctly.
If monospace doesn’t do it for you, take a look on Google Fonts for one which displays the text how you want it to. Just note than slightly unbalanced sharp brackets are not uncommon. If you can’t resolve it by swapping out the font, adding a space between the <> and the text inside will also make the balance look slightly more even as it won’t have the characters so close together. Experiment with different combinations, and see what you like!
2
Answers
The following should do it:
h2 { text-align: center; }
It looks like this might be more to do with the font than the styling. As you said, the
<>
are a few pixels higher than the rest of the text. This is the case in some fonts but not others – for example the monospace font used here on stackoverflow has them in the same line on my screen. You might have better results changing the font to a mono one, using something like:in your css file.
You may also find this better suits the aesthetic of your website, if I’m reading the context cues in your styling correctly.
If
monospace
doesn’t do it for you, take a look on Google Fonts for one which displays the text how you want it to. Just note than slightly unbalanced sharp brackets are not uncommon. If you can’t resolve it by swapping out the font, adding a space between the<>
and the text inside will also make the balance look slightly more even as it won’t have the characters so close together. Experiment with different combinations, and see what you like!