theniteowl
Programmer
Hi All,
I am trying to use a span tag with some text in it and a style applied to the span.
Is it possible to get the span to only be as wide and tall as the text inside it without having to specify exact dimensions? The text content and even font settings may change in which case the span will have to accomodate that change as well but if I do not specify an exact width in CSS it grows to the full width of the screen.
Also, if I place several of these spans side by side I have problems with them wrapping to the next line and stacking above each other rather than ligning up side by side.
Help?
If it can be done can you give an example with a simple style that just changes the background color to distinguish it on the page?
I would post code but the CSS is doing a LOT more than what I describe above and would just be confusing. If I can just see how to get the width to only set itself as wide as the text within I should be able to modify my own code.
Thanks.
Stamp out, eliminate and abolish redundancy!
I am trying to use a span tag with some text in it and a style applied to the span.
Is it possible to get the span to only be as wide and tall as the text inside it without having to specify exact dimensions? The text content and even font settings may change in which case the span will have to accomodate that change as well but if I do not specify an exact width in CSS it grows to the full width of the screen.
Also, if I place several of these spans side by side I have problems with them wrapping to the next line and stacking above each other rather than ligning up side by side.
Help?
If it can be done can you give an example with a simple style that just changes the background color to distinguish it on the page?
I would post code but the CSS is doing a LOT more than what I describe above and would just be confusing. If I can just see how to get the width to only set itself as wide as the text within I should be able to modify my own code.
Thanks.
Stamp out, eliminate and abolish redundancy!