Which value should you use?

You are developing an HTML5 page.
The page includes the following code.

The inner paragraph must be exactly 15 pixels from the top left corner of the outer paragraph.
You set the left style for the inner paragraph to the appropriate value.
You need to set the position property of the inner paragraph.
Which value should you use?

You are developing an HTML5 page.
The page includes the following code.

The inner paragraph must be exactly 15 pixels from the top left corner of the outer paragraph.
You set the left style for the inner paragraph to the appropriate value.
You need to set the position property of the inner paragraph.
Which value should you use?

A.
absolute

B.
static

C.
fixed

D.
relative

Explanation:
http://www.w3schools.com/cssref/pr_class_position.asp



Leave a Reply 5

Your email address will not be published. Required fields are marked *


Dhruv

Dhruv

The answer should be A. Absolute.

The question talks about “15 pixels from the top left corner of the outer paragraph” and not bottom left corner of the outer paragraph.

Martin

Martin

The answer D. Relative is absolute correct.

Ken

Ken

The answer should be “A” as it has already stated there “the paragraph must be EXACTLY 15 pixels from top left corner”. If “relative”, the position might be changed if there is an extra element inside the outer container.

stijn

stijn

i think A too

Rahedul Islam

Rahedul Islam

Answer should be A. Because Absolute property is used in “The element is positioned relative to its first positioned (not static) ancestor element”