Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apply Margins Making Text Not Wrap

Status
Not open for further replies.

BoulderBum

Programmer
Jul 11, 2002
2,179
US
I'm using a technology that pumps out a repeated set of span tags that end up looking like:

Code:
<span style="white-space:nowrap;">[b]content here[/b]</span>

It works great, but I tried to space out the area between the spans by setting its margin or padding in CSS (e.g. padding: 10px, 10px, 10px, 10px). Unfortunately, doing so makes it so that all of the elements end up on the same line, and 1/2 of the elements end up off the screen!

Naturally without the padding/margin, everything cleanly goes to a new line when it overflows the page.

What the heck is going on? Is there a way to add padding to the elements without seeing this quirk?
 
I'm not entirely sure whether this:

Code:
padding: 10px, 10px, 10px, 10px;

is valid CSS or not. Try removing the comma seperators to have just:

Code:
padding: 10px 10px 10px 10px;

which can be made even simpler:

Code:
padding: 10px;

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
It's not valid CSS. Try typing it into the CSS Validator textarea. :)
 
Oops. Thanks for that.

I did make that correction, but the weird nowrap-no-longer-working issue still exists. :-(

Any ideas?
 
Actually I should clarify: once applying padding, none of the spans end up flowing when the page becomes too small: all of the elements are on a single line which goes off the page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top