Alignment
The alignment of objects is done using the top
, bottom
, left
, and right
properties inside the style attribute.
Note: In order for these to work the properly
position: absolute;
must be set. The values that you can fill in can be in px
meaning pixels on the screen or %
which would be the precentage from that side of the screen.
For example: style="position:absolute;left:50%;"
would put the element's left hand side in the middle of the screen.
You should only set one value for each direction. For example if you set top
then setting bottom
would not make sense.
Things that won't work
Here multiple style tags are specified. You should only use one:<div style="position:absolute;" style="left:50%;"> </div>
Here a =
is used instead of a :
<div style="position=absolute;left=10px"> </div>