Search Header Logo

CSS Layout and Positioning Quiz

Authored by Mostafa Khairy

Computers

University

Used 1+ times

CSS Layout and Positioning Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does `margin: auto;` work when applied to an element with a specified width in a block layout?

The margin collapses

It centers the element horizontally

It has no effect

It aligns the element to the left

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Hey there, design wizards! If Henry wants to prevent content from overlapping the border due to negative margins, which property should he adjust?

`padding`

`border`

`overflow`

`box-sizing`

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Hey Abigail! In a design class, when two vertically adjacent margins collapse, which margin stays?

The larger margin is used

The smaller margin is used

The margins are averaged

The margins are removed

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you prevent margin collapsing between two adjacent elements?

Use `display: flex;`

Use `padding` on one of the elements

Use `float: left;` on both elements

Use `box-sizing: content-box;`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Hey students! Which factor does NOT influence the computed height of an element with `box-sizing: border-box;`?

Padding

Border

Margin

Content

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens to an inline element when `width` and `height` properties are applied?

The element stretches to the specified width and height

The properties are ignored

The element becomes a block-level element

The properties are applied but not visible

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does the box model differ between `display: inline-block;` and `display: block;`?

Margin is ignored for `inline-block`

Padding affects the size of `inline-block` elements

Borders do not apply to `inline-block`

Width is ignored in `inline-block` elements

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers