View Full Version : CSS wtih DIV


Opv
12-15-2004, 03:01 AM
Is there a way to force a <DIV> to have a height of 0? I have tried

<DIV style="height: 0;">

However, the DIV continues to default to a minimum height greater than 0. It will let me set the height to 1, but that leaves a noticable line since my actual DIV has a background color different from the main body.

Any help in forcing the height to 0 will be appreciated.

Opv

ivchameleon
12-15-2004, 03:57 AM
You could set the DIV to be transparent, with a height of 1. And then you wouldn't see it. ^_^;;;

Opv
12-15-2004, 04:03 AM
That would work if it was a stationary div which served no utility. I'd rather have it go to a 0 height, if that is possible. Thanks anyway.

Opv

Monkey Bizzle
12-15-2004, 04:30 AM
why not have no div at all... i mean, what's the point of having a div that has no height??

Opv
12-15-2004, 04:38 PM
Well, I have achieved getting the DIV to a height of 0 by adding a "line-height: 0" to the CSS command. However, that leaves me with a new problem. When I open my div, only half of one line of its content is visible.

Dynamically changing the line height back and forth when I open and close the DIV tends to make the process irratic and choppy rather than opening and closing smoothly.

I don't have this CSS problem when it is applied to an Iframe. In fact, it's strange to me that I can dynamically open and close an Iframe slowly and smoothly using an initial height of 0 with no problem, but I can't seem to get the DIV work using the same script.

Opv