Bootstrap MCQs – Forms and Inputs

21.) How do you make a form input full-width in Bootstrap?

A) .full-width
B) .form-wide
C) .w-100
D) .input-expand

Answer: Option C

Explanation: The .w-100 class ensures the input field takes 100% width of its parent container.

22.) What is the correct way to create a floating label for an input field in Bootstrap?

A) Use .floating-label
B) Use .form-floating with <label>
C) Use .form-label-top
D) Use .float-label

Answer: Option B

Explanation: .form-floating allows labels to float above the input field when the user types.

23.) What Bootstrap class is used to style a disabled input field?

A) .input-disabled
B) .form-control-disabled
C) .disabled
D) disabled attribute

Answer: Option D

Explanation: The disabled attribute prevents users from interacting with the input.

24.) How can you add a search icon inside a Bootstrap input field?

A) Use .input-group with <i class=”bi bi-search”> </i>
B) Use .form-search
C) Apply .icon-input
D) Use .form-icon

Answer: Option A

Explanation: Bootstrap allows adding icons inside input fields using the .input-group and elements.

25.) Which Bootstrap class is used to create a file upload input field?

A) .form-upload
B) .file-control
C) .form-file
D) .form-control with type=”file”

Answer: Option D

Explanation: The .form-control class applies Bootstrap styling to file input fields.

26.) How do you make a Bootstrap input field display a placeholder?

A) .form-placeholder=”Text”
B) .placeholder=”Text”
C) placeholder=”Text” attribute
D) .input-text=”Text”

Answer: Option C

Explanation: The placeholder attribute provides a hint inside the input field.

Leave a Reply

Your email address will not be published. Required fields are marked *