Which CSS3 style should you use?

Posted by: Pdfprep Category: 70-480 Tags: , ,

You are developing a web page by using HTML5.

You have the following requirements:

• An H1 element must be placed at the top left corner of the page.

• The size and location of the H1 element must not change if additional elements are added to the page.

You need to position the H1 element on the page.

Which CSS3 style should you use?

A . Option A
B . Option B
C . Option C
D . Option D

Answer: A

Explanation:

* The position property specifies the type of positioning method used for an element (static, relative, absolute or fixed).

absolute: The element is positioned relative to its first positioned (not static) ancestor element

* For absolutely positioned elements, the left property sets the left edge of an element to a unit to the left/right of the left edge of its containing element.

CSS Syntax

left: auto|length|initial|inherit;

length: Sets the left edge position in px, cm, etc.

Incorrect:

position static: Default value. Elements render in order, as they appear in the document flow

Reference: CSS position Property; CSS left Property

Leave a Reply

Your email address will not be published.