Jump to content

how do I stop text from overflowing out of its div


Recommended Posts

Hi,

 

I've got a div that contains text retrieved from a database. I want to ensure that the text deosn't overflowfrom the div even if this means that some of the text can'tbe read.

 

Is there a way to this?

 

The div has width and height.I wouldof thought that would be enough.

 

thanks

 

Use the CSS "overflow" property:

 

Example

 

div{

  overflow: scroll;

}

 

Possible Values

 

visible - Default. The content is not clipped. It renders outside the element

hidden - The content is clipped, but the browser does not display a scroll-bar to see the rest of the content

scroll - The content is clipped, but the browser displays a scroll-bar to see the rest of the content

auto - If the content is clipped, the browser should display a scroll-bar to see the rest of the content

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.