There are two methods, in HTML, to specify exactly where an image is to be placed in a browser window, one older method, and one recently added method. Which are the methods, and how do they work?

Possible reply

Older method:

Use tables with table cells with exactly specified height and width in pixels. Example:



Newer method:

Use style sheets. In the style sheet, which can be placed in the <HEAD>, you can specify styles as a kind of subclasses of an HTML command like <DIV> or <P>. A style can specify the exact pixel position of the object content. The HTML text can then contain for example <DIV class=x> which means that this division is to be positioned as specified for the style x.


Other methods

I do not primarily recommend these methods, since they are more complex than Style Sheets.

LAYER can be used, but style sheets do the same more directly.

OBJECT can be used, provided that the object code uses some method for exact positioning.

ALIGN, HSPACE, VSPACE, Non-breaking spaces, Invisible pictures are also tools which can be used to influence the positioning of images.

List of exam questions