HighDots Forums  

Forcing Word-Wrap

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Forcing Word-Wrap in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joel Byrd
 
Posts: n/a

Default Forcing Word-Wrap - 04-25-2006 , 02:52 PM






I've got a div whose width is specified as a percentage so that if you
shrink the browser window, the div shrinks, and the text inside the div

wraps around to accommadate this. The problem is: if I put a really
long word (like a web address) in the div, then it props the rest of
the text open to the width of the word, and the text can't wrap past
that width; but if I shrink the browser window, the div also shrinks
and so the net result is that the words end up running outside of the
div. Is there a way to somehow force a word wrap in this case, or
otherwise solve the problem?


Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Forcing Word-Wrap - 04-25-2006 , 03:33 PM






"Joel Byrd" <joelbyrd (AT) gmail (DOT) com> wrote:

Quote:
if I put a really
long word (like a web address) in the div, then it props the rest of
the text open to the width of the word, and the text can't wrap past
that width;
Well, then don't do that.

You're not supposed to put web addresses onto web pages as visible (or
audible) content but into attributes such as href. It's much more user-
friendly to have a link text and not a mile-long cryptic URL, or even a
reasonable URL.

Rare exceptions mostly consist of tutorial that _discuss_ web addresses.
There the best strategy is put <wbr> into critical places. There will be
remarks about <wbr> not being standard, but it's still the only practical way
to suggest potential breaks without causing trouble. More on this:
http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest

P.S. CSS has nothing to offer in this respect at present, not even at the
theoretical level.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #3  
Old   
Joel Byrd
 
Posts: n/a

Default Re: Forcing Word-Wrap - 04-25-2006 , 04:35 PM



Well, I personally, would generally not put a full url as a link, but
the site I'm dealing with is a site like myspace, with a profile page
where people can put whatever content they want. But, thanks for your
reply and the link - it was quite informative.


Reply With Quote
  #4  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Forcing Word-Wrap - 04-25-2006 , 05:01 PM



"Joel Byrd" <joelbyrd (AT) gmail (DOT) com> wrote:

Quote:
Well, I personally, would generally not put a full url as a link, but
the site I'm dealing with is a site like myspace, with a profile page
where people can put whatever content they want.
That's what I suspected. The solution is to put limits on what people can put
there - or accept the consequences. If you set up, say, a guestbook where
people can put just anything, they will, sooner or later - and you cannot
expect to fix this by styling. You need control over content.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #5  
Old   
frederick
 
Posts: n/a

Default Re: Forcing Word-Wrap - 04-25-2006 , 05:24 PM



Joel Byrd wrote:
Quote:
Well, I personally, would generally not put a full url as a link, but
the site I'm dealing with is a site like myspace, with a profile page
where people can put whatever content they want. But, thanks for your
reply and the link - it was quite informative.
I take it that there's no possibility of using something like scripting
to parse the content, and if necessary "chop up" lengthy character
sequences?


--
AGw.



Reply With Quote
  #6  
Old   
Joel Byrd
 
Posts: n/a

Default Re: Forcing Word-Wrap - 05-23-2006 , 01:32 PM



Just out of curiosity, how does
gooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooogle
handle word-wrap?


Reply With Quote
  #7  
Old   
Joel Byrd
 
Posts: n/a

Default Re: Forcing Word-Wrap - 05-23-2006 , 01:56 PM



Ok, that's interesting - looks like they check for length and add a
­ to break up the word. Hmmm....&#173 doesn't show up when I
tried adding it to a web page. Is anyone familiar with ­ ? I
mean it renders as a dash on this page, but I'm not sure why I can't
see it on my own web page.

Another test, lets see what is does with a really long link:
http://www.w3schools.com/vbscript/vbscript_examplesadsfadsfasdfjijwijoieljsdlifjljmb kjnblkmlmlbkmlsimblimlsimalimslvmblskamvlismalimbs ambliamfsblimfdsilbmnalidsfmbmblbmnlianflbianslvba lfkblasvblanlvbadsfblkalklviajnsjvliasjdvlijsalidf jlksajfdlkajsldfkjlakjsdflkj.asp">http://www.w3schools.com/vbscript/vb...lakjsdflkj.asp

Ok, how does that look?


Reply With Quote
  #8  
Old   
Joel Byrd
 
Posts: n/a

Default Re: Forcing Word-Wrap - 05-23-2006 , 02:04 PM



Ok, they just put "..." in the address you see on the page while
retaining the full href in the html. yeah, that works. (not quite
sure why it listed it twice with a ">" between them, though...).


Reply With Quote
  #9  
Old   
Jack
 
Posts: n/a

Default Re: Forcing Word-Wrap - 05-23-2006 , 02:16 PM



Joel Byrd wrote:
Quote:
Ok, they just put "..." in the address you see on the page while
retaining the full href in the html. yeah, that works. (not quite
sure why it listed it twice with a ">" between them, though...).

Have you ever heard of alt.test?

--
Jack.


Reply With Quote
  #10  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Forcing Word-Wrap - 05-23-2006 , 04:22 PM



Joel Byrd <joelbyrd (AT) gmail (DOT) com> scripsit:

Quote:
Ok, that's interesting - looks like they check for length and add a
­ to break up the word.
Who? Where? What? And what was the relation to stylesheets?

Quote:
Is anyone familiar with ­ ?
Yes, but what are talking about, and why are you talking about it here?

If you mean posting to Usenet via Google Groups, that's a bad idea, and it's
not a stylesheet issue.

--
Yucca, http://www.cs.tut.fi/~jkorpela/



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.