Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Netscape Communicator
Expertise: Beginner
Oct 18, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Set DIV Clipping Height


I am inserting some text into a DIV in Netscape using the .open, write(), and close() methods. At first there is nothing in the DIV, and when I check the clip.height value and .height value, both are 0. Then I insert some text into the DIV and the clip.height value increases to 30, but the .height value remains at 0. The problem is that when I write to the DIV again—this time with a blank string—the clip.height does not reduce; it stays at the higher value. So it is dynamically increasing, but not decreasing.


By default the clipping region values are set to zero if the element does not contain any content and you don't provide a value using Cascading Style Sheets (CSS). When you add content to the layer, Netscape attempts to automatically set the clipping region based on default rendering behavior, which is to wrap on the right and set height to fit the content. You can set the clipping height back to zero using JavaScript:

layername.clip.height = 0
DevX Pro
Thanks for your registration, follow us on our social networks to keep up-to-date