html - Non-breaking space between span content and text -
can make non-breaking space between span
content , text? read it, don't see same situation.
<span style="some_style"> <span number="1">1</span>"some big text" </span>
i need add non-breaking space between span
content (number="1"
) , first word after only.
thank
on seeing example image, i'm not sure asking need.
i suspect 'number' span should outside containing block involve absolute positioning.
like so.
.some_style { display: block; width: 50%; margin: 1em auto; position: relative; text-align: justify; } span[number] { position: absolute; top: 0; left: -1em; }
<span class="some_style"> <span number="1">1</span> lorem ipsum dolor sit amet, consectetur adipisicing elit. est incidunt ducimus facilis quae magnam vel sit alias consequatur voluptate modi repellat enim eaque soluta accusantium. </span> <span class="some_style"> <span number="2">2</span> lorem ipsum dolor sit amet, consectetur adipisicing elit. est incidunt ducimus facilis quae magnam vel sit alias consequatur voluptate modi repellat enim eaque soluta accusantium. </span>
in fact, using data-attributes
, can without internal span entirely.
.some_style { display: block; width: 50%; margin: 1em auto; position: relative; text-align: justify; } .some_style:before { position: absolute; content: attr(data-number); top: 0; left: -1em; }
<span class="some_style" data-number="1"> lorem ipsum dolor sit amet, consectetur adipisicing elit. est incidunt ducimus facilis quae magnam vel sit alias consequatur voluptate modi repellat enim eaque soluta accusantium. </span> <span class="some_style" data-number="2"> lorem ipsum dolor sit amet, consectetur adipisicing elit. est incidunt ducimus facilis quae magnam vel sit alias consequatur voluptate modi repellat enim eaque soluta accusantium. </span>
Comments
Post a Comment