In a lg viewport, how wide is the div with class "col-lg-2 col-sm-5"?

Prepare for the Web Development 201 Test. Study with flashcards, multiple-choice questions, and detailed explanations. Get exam-ready!

To determine the width of a div with the classes "col-lg-2 col-sm-5" in a large (lg) viewport, it is essential to understand how the Bootstrap grid system operates. In Bootstrap, the grid system is based on a 12-column layout.

When a class like "col-lg-2" is applied to an element, it signifies that in the large viewport size, the element should span 2 out of the 12 available columns. Therefore, this class applies specifically to large screens, meaning that when the viewport is classified as large, the div will occupy 2 columns of space.

The "col-sm-5" class indicates that when the viewport is classified as small, the div will occupy 5 columns out of the same 12. However, since the question specifically asks for the div width in a large viewport, the "col-lg-2" declaration takes precedence.

The total width is always out of 12 columns, so the correct answer, representing the div's width in a large viewport, is indeed 2.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy