80.7k views
2 votes
Which of the following code segments will create two equal columns?

A.

.col-sm-4
.col-sm-8

B.

.col-sm-4
.col-sm-4
.col-sm-4

C.

.col-sm-4
.col-sm-4

D.

.col-sm-4
.col-sm-4
.col-sm-4

1 Answer

6 votes

Final answer:

Option C, .col-sm-4.col-sm-4, is the code segment that should create two equal columns but it spans only 8 out of the 12 columns in the Bootstrap grid, hence it's not correct for two equal full-width columns. Option B with .col-sm-6.col-sm-6 would be correct if it were provided.

Step-by-step explanation:

The code segment that will create two equal columns is option C: .col-sm-4.col-sm-4. The reason for this is that in the Bootstrap framework, the grid system divides the page into 12 equal columns. To create two equal columns, you need to span 6 columns each. Using .col-sm-4.col-sm-4 will create two divs, each taking up 4 out of the 12 columns, totaling 8 columns which is not a full row, hence they are not equal columns for the full width of the row.

However, if you're aiming for equal columns spanning the full width, you could use .col-sm-6.col-sm-6, which is not listed in the options provided. But out of the provided options, B would be the closest solution if it used .col-sm-6 instead of .col-sm-4.

User Tiago Martins
by
7.8k points