0
0
Bootsrapmarkup~20 mins

Form control basics in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap Form Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the purpose of the form-control class in Bootstrap?
Bootstrap uses the form-control class on input elements. What does this class do?
AIt styles input elements to have consistent width, padding, and border for better usability.
BIt hides the input element from the user interface.
CIt automatically validates the input data on the client side without extra code.
DIt converts input fields into dropdown menus.
Attempts:
2 left
💡 Hint
Think about how Bootstrap helps inputs look uniform and easy to use.
📝 Syntax
intermediate
2:00remaining
Which code correctly creates a Bootstrap text input with label?
Select the option that correctly uses Bootstrap classes to create a labeled text input.
A<label for="emailInput">Email</label><input type="email" class="form-control" id="emailInput">
B<input type="email" class="form-control" id="emailInput"><label>Email</label>
C<label>Email</label><input type="email" id="emailInput">
D<label for="emailInput">Email</label><input type="email" class="input-control" id="emailInput">
Attempts:
2 left
💡 Hint
Remember the label's for attribute should match the input's id, and the input needs the correct Bootstrap class.
rendering
advanced
2:00remaining
What will the following Bootstrap form control look like in the browser?
Given this code, what visual result will you see in a modern browser?
Bootsrap
<input type="text" class="form-control" placeholder="Enter your name" aria-label="Name input">
AA plain text label 'Enter your name' with no input box.
BAn invisible input field with no visible border or placeholder.
CA small button labeled 'Enter your name'.
DA wide text box with padding and border, showing grey placeholder text 'Enter your name'.
Attempts:
2 left
💡 Hint
Think about how Bootstrap styles inputs and what placeholder text does.
selector
advanced
2:00remaining
Which CSS selector targets all Bootstrap form controls inside a form with class user-form?
Choose the correct CSS selector to style all inputs with class form-control inside a form having class user-form.
Auser-form > form .form-control
B.form-control user-form form
Cform.user-form .form-control
Dform .user-form .form-control
Attempts:
2 left
💡 Hint
Remember the order: parent element, then descendant with class.
accessibility
expert
2:00remaining
Which attribute improves accessibility for screen readers on Bootstrap form controls?
You want to make sure screen readers understand the purpose of your input fields. Which attribute is best to add to a Bootstrap input element?
Aplaceholder
Baria-label
Conclick
Ddata-toggle
Attempts:
2 left
💡 Hint
This attribute provides a text description specifically for assistive technologies.