Using HTML 5.0, it is possible to fix width of text block using <span>
or <div>
.
For <span>
, what is important is to add following CCS line
display: inline-block;
For your empty <span>
what is important is to add
space.
My code is following
body_x000D_
{_x000D_
font-family: Arial;_x000D_
font-size:20px;_x000D_
}_x000D_
_x000D_
div_x000D_
{_x000D_
width:200px;_x000D_
font-size:80px;_x000D_
background-color: lime;_x000D_
}_x000D_
div span_x000D_
{_x000D_
display:block;_x000D_
width:200px;_x000D_
background-color: lime;_x000D_
}_x000D_
_x000D_
ul li span_x000D_
{_x000D_
display: inline-block;_x000D_
width: 80px;_x000D_
background-color: yellow;_x000D_
}_x000D_
span.tab_x000D_
{_x000D_
display: inline-block;_x000D_
width: 80px;_x000D_
background-color: yellow;_x000D_
}
_x000D_
<DIV>_x000D_
_x000D_
<div class='test'>ABCDEF</div>_x000D_
_x000D_
<SPAN>_x000D_
_x000D_
<div>_x000D_
<span class='test'>ABCDEF</span>_x000D_
</div_x000D_
_x000D_
<br>_x000D_
_x000D_
<ul>_x000D_
<li><span class='tab'> </span> The lazy dog.</li>_x000D_
<li><span class='tab'>AND</span> The lazy cat.</li>_x000D_
<li><span class='tab'>OR</span> The active goldfish.</li>_x000D_
</ul>
_x000D_
PS: I have defined tab
class because ul li span
CSS selector is not working on my PC !