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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No Break in CSS? 1

Status
Not open for further replies.

ThatRickGuy

Programmer
Oct 12, 2001
3,841
US
Is it possible to set No Break on via CSS?

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Code:
white-space: no-wrap;
is the css equivalent of nowrap.
 
What I'm working at is a 3 column layout of data, where in each column contains an Extension, an icon (for out of office) and a name. The span containing the name can only be some width, if the name is Bob Asareallylonglastname, Bob will show up on the first line, and Asareallylonglastname will wrap to the next line. I need to keep in on one line. I used to use the html tag <NOBR>...</NOBR> but I was wondering if there is a way to do that via CSS.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Thanks!

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Oh, and unless changed into block level elements, spans cannot have width. Even though that most used browser will acknowledge it.
 
That would answer one of my next questions ;)

So how could I set up a Div to crop anything that goes outside of it's area?

This is the style I have for the name div. Unfortunatly, the White-space style isn't preventing 'Bob Asareallylonglastname' from wrapping. And if I use <NOBR> the text extends outside of this div.

Code:
div.Name{
	POSITION:absolute;
	LEFT:51;
	WIDTH:200;
	WHITE-SPACE:no-wrap;}

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Man, I feel stupid. go for 2 years with out doing a lick of web work and this stuff gets completely forgotten. I supose I should stick in a strict doctype and get my head back in the game ;) Thanks guys!

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
whoops, looks like
Code:
white-space: no-wrap;
should be
Code:
white-space: nowrap;

It's working like a champ now!

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Me again. I put the PITA up on my site so you can see what it is doing. If the Name value is short enough for the div's width, it's put on line 1. But if it is longer then the remaining space on line 1, it is put on line 2. Once it's on line 2 it crops correctly. What I'm trying to do is to get the whole div on one line (ext, out of office icon, name). And just crop any of the name that doesn't fit. Any pointers?


-Rick



----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Ahh well, a little beating and a little position:absolute and I got it close enough. I put the corrected code on the posted link if anyone else runs into a thing like this.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top