Jump to content

how do I stop text from overflowing out of its div


poleposters

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.