Attribute for <APPLET ...>
ALIGN =
LEFT
| RIGHT
| TOP
| MIDDLE
| BOTTOM
| BASELINE
ALIGN
sets the alignment of the applet relative to the text around it.
ALIGN
works much like
<IMG ALIGN="...">
The values for ALIGN
can be divided into two groups:
LEFT
and
RIGHT
, which put the applet on the left or right side of the page; and all the other values, which concern the vertical placement of an inline applet.
LEFT
and RIGHT
LEFT
and
RIGHT
put the applet on the left or right side of the page and cause the text to wrap around it:
this code |
produces this |
<APPLET
CODE="MyApplet.class"
ALIGN=LEFT
HEIGHT=50 WIDTH=50>
|
Come on down to our beautiful town! We'll show you a right good time and some tasty food to boot! |
<APPLET
CODE="MyApplet.class"
ALIGN=RIGHT
HEIGHT=50 WIDTH=50>
|
Come on down to our beautiful town! We'll show you a right good time and some tasty food to boot! |
Text will continue to wrap around the applet until it gets past the applet, or until you use
<BR CLEAR="...">
to cause text to skip down to after the applet:
this code |
produces this |
<APPLET
CODE="MyApplet.class"
ALIGN=LEFT
HEIGHT=150 WIDTH=50>
<PARAM NAME=TEXT VALUE="Howdy!">
</APPLET>
Come on down to our beautiful town!<BR CLEAR=ALL>
We'll show you a right good
time and some tasty food to boot!
|
Come on down to our beautiful town!
We'll show you a right good
time and some tasty food to boot! |
If the text looks crowded too close to the applet, you may want to check
<APPLET HSPACE="...">
and
<APPLET VSPACE="...">
.
The Other Values
All other values for
ALIGN
define the vertical position of the applet to the surrounding text. With these other values, text does not wrap around the applet.
Default
This is to show how text behaves without
ALIGN
this code |
produces this |
<APPLET
CODE="MyApplet.class"
HEIGHT=50 WIDTH=50>
|
Xy
|
TOP
Aligns the top of the applet with the top of the text
this code |
produces this |
<APPLET
CODE="MyApplet.class"
ALIGN=TOP
HEIGHT=50 WIDTH=50>
|
Xy
|
MIDDLE
This value has particularly different results in different browsers. In some browsers,
ALIGN
aligns the
middle of the text with the middle of the applet. In other, it
aligns the
bottom of the text with the middle of the applet
this code |
produces this |
<APPLET
CODE="MyApplet.class"
ALIGN=MIDDLE
HEIGHT=50 WIDTH=50>
|
X
|
BOTTOM
Aligns the bottom of the applet with the bottom of the text
this code |
produces this |
<APPLET
CODE="MyApplet.class"
ALIGN=BOTTOM
HEIGHT=75 WIDTH=75>
|
Xjy
|
BASELINE
Aligns the bottom of the applet with the baseline of the text.
The baseline is the line along which the bottom of most letters rest, but
below which some letters dangle, such as j and y.
this code |
produces this |
<APPLET
CODE="MyApplet.class"
ALIGN=BASELINE
HEIGHT=75 WIDTH=75>
|
Xjy
|