COMP 126 MIDTERM EXAM 2025/2026
QUESTIONS AND ANSWERS 100% PASS
If you don't explicitly set a value for the position property of an element, what value will it
have?
a) No position values
b) Position: absolute;
c) Position: relative;
d) Position: static; - ANS d) position static
How do elements behave in what we call the "normal (or natural flow of the document"?
a. they stack top to bottom
b. they flow left to right
c. they flow left to right & top to bottom
d. they overlap unless directed otherwise - ANS c. they flow left to right & top to bottom
Which position value leaves an element in the normal/natural flow of the document?
a. static
b. relative
c. fixed
d. absolute - ANS a. static
When you set position: relative; on an element, what is that element being positioned relative
to?
1 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED
, a. the four edges of the browser window
b. wherever the element would end up in the normal flow of the document
c. the next nearest element
d. the next nearest block element - ANS b. wherever the element would end up in the
normal flow of the document
When you set position: abolute; on an element, what is that element positioned in relation
too?
a. it's parent element
b. the viewport
c. the browser window
d. the elements nearest neighbor - ANS a. it's parent element
Which of the following must also happen in order to absolute-ly position an element?
a. the element must be a block-level element
b. the element must be an inline element
c. the element cannot have any child elements
d. the elements parent element must also be given a position value - ANS d. the elements
parent element must also be given a position value
What position value do you set on an element to position it relative to the four sides of the
viewport?
a. relative
b. absolute
c. fixed
d. static - ANS c. fixed
When you apply a position value, what should you generally also provide to position the
element where you want it?
a. the elements offset values
2 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED
QUESTIONS AND ANSWERS 100% PASS
If you don't explicitly set a value for the position property of an element, what value will it
have?
a) No position values
b) Position: absolute;
c) Position: relative;
d) Position: static; - ANS d) position static
How do elements behave in what we call the "normal (or natural flow of the document"?
a. they stack top to bottom
b. they flow left to right
c. they flow left to right & top to bottom
d. they overlap unless directed otherwise - ANS c. they flow left to right & top to bottom
Which position value leaves an element in the normal/natural flow of the document?
a. static
b. relative
c. fixed
d. absolute - ANS a. static
When you set position: relative; on an element, what is that element being positioned relative
to?
1 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED
, a. the four edges of the browser window
b. wherever the element would end up in the normal flow of the document
c. the next nearest element
d. the next nearest block element - ANS b. wherever the element would end up in the
normal flow of the document
When you set position: abolute; on an element, what is that element positioned in relation
too?
a. it's parent element
b. the viewport
c. the browser window
d. the elements nearest neighbor - ANS a. it's parent element
Which of the following must also happen in order to absolute-ly position an element?
a. the element must be a block-level element
b. the element must be an inline element
c. the element cannot have any child elements
d. the elements parent element must also be given a position value - ANS d. the elements
parent element must also be given a position value
What position value do you set on an element to position it relative to the four sides of the
viewport?
a. relative
b. absolute
c. fixed
d. static - ANS c. fixed
When you apply a position value, what should you generally also provide to position the
element where you want it?
a. the elements offset values
2 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED