You are here: Test Case Description for applets within <applet> tag > Test Case #7 for applets within <applet>: relative height
Applets: APPLET (relative height)
This test case tests the <applet> tag with its height attribute which, similar to the <img> tag, explicitly specifies the height of the java applet. The height attribute can either be an absolute height using an integer value of pixels or a relative height using a relative percentage value.
If the height attribute of an <applet> is using a relative height and if the height of its containing block is not specified explicitly (i.e., it depends on content height), then the height of the <applet> will compute to "auto". When this case happens, then the height refers to the intrinsic height for <applet> which is 240px. Therefore, if the height attribute of an <applet> is using a relative height, then the height of its containing block should be specified explicitly.
Java Applet Dimensions Scaled Down (Reverse Scaling)
Original applet (with an height of 80px)
Applet height="75%" within a
<p> with a specified height of 400px
Applet height="50%" within a
<p> with a specified height of 400px
Applet height="25%" within a
<p> with a specified height of 400px
Applet height="80%" within a
<p> that has no specified height, with an auto-height
The above <applet> should be 240px in height precisely.