I want to remove the
\'s and do the break lines through CSS. If I change the spans to display:block
the width will go 100% and I need the w
If you're OK with not using The trick is to wrap each one of your s (only
s), this solution might even allow you to align your
inline-block
s center or right, if you want to (or just keep them left, the way you originally asked for). While the solution might still work with s, I don't think the resulting HTML code would be quite correct, but it's up to you anyways.
s with a corresponding
display: block
(default), while still keeping the visual green box tight to the limits of the text (with your display: inline-block
declaration).
.text span {
background:rgba(165, 220, 79, 0.8);
display:inline-block;
padding:7px 10px;
color:white;
}
.large { font-size:80px }