Bootstrap Quiz

Bootstrap is a popular CSS framework for building responsive layouts quickly. Questions focus on the grid system, breakpoints, utility classes, components such as navbars and cards, and how to customise them.

What this quiz covers

Study tip: Resize your browser window while testing a Bootstrap page to see how each breakpoint changes the layout.

Questions, answers and explanations

1. What is Bootstrap?

  1. A JavaScript library
  2. A CSS framework
  3. A database
  4. A programming language

Answer: A CSS framework

Bootstrap is a popular front-end CSS framework used to build responsive websites.

2. Who developed Bootstrap?

  1. Google
  2. Twitter
  3. Facebook
  4. Microsoft

Answer: Twitter

Bootstrap was originally developed by Mark Otto and Jacob Thornton at Twitter.

3. Which class creates a responsive fixed-width container?

  1. .container
  2. .wrapper
  3. .box
  4. .grid

Answer: .container

The .container class provides a responsive fixed-width layout.

4. Which class creates a full-width container?

  1. .container-fluid
  2. .container
  3. .fluid
  4. .row

Answer: .container-fluid

The .container-fluid class always takes 100% of the viewport width.

5. Bootstrap uses how many columns in its grid system?

  1. 10
  2. 12
  3. 16
  4. 24

Answer: 12

Bootstrap's grid system is based on 12 columns.

6. Which class is used to create a row in Bootstrap?

  1. .grid
  2. .row
  3. .column
  4. .container

Answer: .row

The .row class is used to group columns together.

7. Which class creates a primary button?

  1. .btn-primary
  2. .button-primary
  3. .primary-btn
  4. .btn-blue

Answer: .btn-primary

Bootstrap provides the .btn-primary class for primary buttons.

8. Which class makes an image responsive?

  1. .img-fluid
  2. .responsive-img
  3. .img-responsive
  4. .fluid-image

Answer: .img-fluid

The .img-fluid class makes images scale with the parent container.

9. Which Bootstrap class centers text?

  1. .text-center
  2. .center
  3. .align-center
  4. .text-middle

Answer: .text-center

The .text-center utility class centers text horizontally.

10. Which Bootstrap component is used for site navigation?

  1. Navbar
  2. Card
  3. Modal
  4. Carousel

Answer: Navbar

The Navbar component is used to create responsive navigation bars.

11. Which class adds rounded corners to an element?

  1. .rounded
  2. .border-round
  3. .radius
  4. .curve

Answer: .rounded

The .rounded class adds rounded corners to Bootstrap elements.

12. Which class creates a danger (red) button?

  1. .btn-danger
  2. .btn-red
  3. .danger-btn
  4. .btn-error

Answer: .btn-danger

The .btn-danger class creates a red button for dangerous actions.

13. Which Bootstrap component is used to display dismissible messages?

  1. Alert
  2. Badge
  3. Card
  4. Toast

Answer: Alert

Bootstrap Alerts display important messages and can be dismissible.

14. Which component is used to create image sliders?

  1. Carousel
  2. Slider
  3. Gallery
  4. Scroll

Answer: Carousel

Bootstrap Carousel is used to create responsive image sliders.

15. Which Bootstrap class is used to hide an element?

  1. .d-none
  2. .hidden
  3. .display-none
  4. .invisible

Answer: .d-none

The .d-none utility completely hides an element.

16. Which class adds margin on all sides?

  1. .m-3
  2. .p-3
  3. .margin
  4. .space

Answer: .m-3

The m-* utility classes add margin to elements.

17. Which class adds padding on all sides?

  1. .p-3
  2. .m-3
  3. .padding
  4. .space

Answer: .p-3

The p-* utility classes add padding to elements.

18. Which Bootstrap component is commonly used to display content inside a box with a shadow?

  1. Card
  2. Modal
  3. Navbar
  4. Tooltip

Answer: Card

Cards are flexible content containers with multiple layout options.

19. Which Bootstrap class changes text color to white?

  1. .text-white
  2. .white-text
  3. .color-white
  4. .font-white

Answer: .text-white

The .text-white utility changes the text color to white.

20. Which Bootstrap class makes an element's width 100%?

  1. w-100
  2. width-full
  3. .full-width
  4. .w-full

Answer: w-100

The w-100 utility class sets an element's width to 100%.

Take the timed quiz