aaarrrggghhh! text overflowing a simple div help! (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


jeffw -> aaarrrggghhh! text overflowing a simple div help! (3/11/2004 19:42:45)

OK, i have a very simple absolutely positioned div that has a specified width and height. I have text overflowing this horizontally, without automatically breaking lines and staying within the boundaries of the div.

This goes against all of my experience w/ CSS and the behavior div/spans and anything that contains text.

It seems like I have tried eveything, but nothing works. In IE/WIN, the div expands to hold the text. In MOZ, the div stays the proper size, but the text just overflows to the right.

I'm stuck! Any help appreciated!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>


<link rel="stylesheet" href="global.css" type="text/css" media="screen" />


</head>

<body>

<div id="crap">aaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbb</div>

</body>

</html>
-----------------------------
#crap {position: absolute;
top: 100px;
left: 125px;
width: 100px;
height: 400px;
border: 1px solid #000;}




Nancy -> RE: aaarrrggghhh! text overflowing a simple div help! (3/12/2004 0:38:27)

If this is the text you're working with, I would assume it can't do much else except stretch the div wider, as it has no way to break the word.

Try using what would be considered normal length words and see how that goes. Very few words used would ever be that many characters, with no spaces.

Nancy




d a v e -> RE: aaarrrggghhh! text overflowing a simple div help! (3/12/2004 1:11:24)

if you need some dummy text this is the classic
http://www.lipsum.com/ (scroll down a bit and you can choose how many paragraphs, etc




Giomanach -> RE: aaarrrggghhh! text overflowing a simple div help! (3/12/2004 3:29:30)

The usual command for overflow on div layers is:

overflow:hidden;

It can have auto or hidden in it. But with regards to the problem at hand, the width is:

width: 100px;

Too short. The word if longer than 100 pixels should go onto the next line. try dropping a text size or making the div wider




caz -> RE: aaarrrggghhh! text overflowing a simple div help! (3/12/2004 6:07:26)

Thanks for this link David, just what I need.

Cheers
Carol
[:D]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
4.614258E-02