Previous Message
Next Message

RE: [css-d] Absolute DIV causes text to overflow

Sent by RUST Randal on 25 January 2002 12:12


You also might want to look at completely separating your CSS from the page.
Dreamweaver's CSS functionality really doesn't work too well if you want to
change things in the future, because of how it allows you to set properties
directly to the <div>.

I don't have the link to your page anymore, so I can't show your actual
code, but here is an example of what you should try to do:

#box1 {
	position: absolute;
	top: 60px;
	left: 150px;
	width: auto;
	height: auto;
	color: #000000;
	background-color: #FFFFFF;
	border: 1px dashed #000000; }

This removes all of the CSS from inside the HTML, so if you ever need to
change it, you just go right to the CSS.  You should also link or import
your CSS into the page.  Dreamweaver allows you to perform either action.


-----Original Message-----
From: Andrew Clover [EMAIL-REMOVED]]
Sent: Friday, January 25, 2002 12:01 PM
Subject: Re: [css-d] Absolute DIV causes text to overflow

Jordan Fritts [EMAIL-REMOVED]> wrote:

> What I can't seem to figure out is why the Mac IE 5.1 and NS 6 (PC - Mac?)
> cause the text in my absolutly positioned div to overflow outside of the
> borders.

Because you have set their 'height' too small to contain the text.

> I was using "overflow: visible" and that didn't work as described

'overflow: visible;' is the default value, so setting it explicitly won't
change anything here. It's working how it's supposed to: 'overflow' only
refers to the content inside the div, it doesn't make the div any larger
to fit content, so the background stays the height you specified.

If you want the div to grow to accommodate the content, simply don't
specify a 'height', or set it to the default value 'auto'.

BTW, you probably also want to use 'px' or 'em'/'%' to size the text rather
than the useless-for-screen-purposes 'pt'.

Andrew Clover
css-discuss mailing list
Previous Message
Next Message

Possibly related: