CliffC CliffC - 4 months ago 21
HTML Question

span text padding increase span size

i have the following span

<SPAN style="border:solid;TEXT-ALIGN: right; FONT-STYLE: normal;width:100px; padding-RIGHT: 50px; DISPLAY: inline-block;PADDING-TOP: 3px">hello world</SPAN>


seems to me the total width of the span is increasing base on the padding size?, is there way to prevent the span size from increasing and pad the text to the right?

thanks

Answer

Don't know if your padding-right actually works with a space there, but it shouldn't be there. Could be another problem as well. you have

padding- right:50px

instead of

padding-right:50px;

Edit: to increase space outside of your span rather than increasing the span itself replace:

padding-right:50px;

with

margin-right:50px;

Here is an example. fiddle with it if you don't quite understand. http://jsfiddle.net/robx/GaMpq/

Comments