Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
Posts: 41
Registered: ‎06-22-2010
My Device: N/A
My Carrier: N/A

Force word break

Yo dudes

 

Anyone know of a way to force a long string of chars in a div to break at the div width boundary, rather than scroll horizontally and mess up the layout, in a BB widget page?

 

I've tried using word-wrap:break-word; (css3) but no dice. I know device software 5.0 supports partial css3 so I can only assume this part isn't included.

 

I'm only targeting device software 5.0, and I'm happy to use javascript if there's a cunning way to use it. I'd rather not have to resort to overflow:hidden if at all possible.

 

Cheers for any help

 

Lee

=============================
Win 7 (32bit)
Eclipse Galileo
BlackBerry Web Plug-in
Version: 2.0.0.201003191451-33
BlackBerry Widget SDK
Version: 1.0.0.201003191451-126
=============================
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Force word break

What if you nest a <p> or a <span> in your <div>?  Do they wrap any different for long words?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified

Re: Force word break

Hello

 

If the size of the string is constant, you may want to consider a textarea

 

  <%@page language="abap"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style>
  textarea{border:none;width:100%;}
</style>
</head>

<body>
    <div>
      <textarea rows="4">gdfgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggend
      </textarea>
    </div>
</table>
</body>
</html>

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Force word break

I think the text area would likely be a good alternative.. you can set its borders to be none, readonly and its background color to be the same as your page.

 

This might give you the effect you are looking for

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter