Does anyone have an idea how to align the second line?
span.info { margin-left: 10px; color: #b1b1b1; font-size: 11px; font-style: italic; font-weight: bold; }
<span class="info"></span>
span is an inline element, as such styling attributes such as width or margin don't work. You can fix that by either changing the span to a block element (such as div ), or by using padding instead.
To center an inline element like a link or a span or an img, all you need is text-align: center . For multiple inline elements, the process is similar. It's possible by using text-align: center .
Text is an inline element and so is a span. For text-align to work, it must be used on a block level element (p, div, etc.) to center the inline content.
display:block;
then you've got a block element and the margin is added to all lines.
While it's true that a span is semantically not a block element, there are cases where you don't have control of the pages DOM. This answer is inteded for those.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With