I'm writing a Markdown theme in CSS but I have some issues with headers styling. Right now the h1
is styled as follows:
h1 {
border-top: 1px solid black;
width: 10%;
margin: 0 0 100px 45%;
padding: 0;
text-align: center;
}
And it renders like this:
The problem is, when the header contains a word which exceeds 10% in width, that word acts like left-aligned.
Key question:
How do I prevent very long words from being left-aligned, without adding HTML tags?