CliffC CliffC - 1 year ago 84
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?


Answer Source

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


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




Here is an example. fiddle with it if you don't quite understand.