Contents

Which CSS property can be used to change the background color of a text input in an HTML form?
a) text-background                            
b) background-color
c) input-background 
d) text-color

b

Explanation: The CSS property "background-color" can be used to change the background color of a text input in an HTML form.


How can you align the text within a button element in an HTML form to the center?
a) text-align: center;         
b) align: center;
c) horizontal-align: center;
d) button-align: center;

a

Explanation: You can align the text within a button element in an HTML form to the center using the CSS property "text-align" with the value "center."


Which attribute is used to set the maximum number of characters allowed in a text input in an HTML form?
a) maxlength                      
b) maxchars
c) maximum                        
d) limit

a

Explanation: The "maxlength" attribute is used to set the maximum number of characters allowed in a text input in an HTML form.


What is the purpose of the "placeholder" attribute in a text input?
a) It changes the appearance of the input field when the cursor hovers over it.    
b) It provides a default value for the input field.
c) It specifies a hint or example of the expected input format to the user.         
d) It restricts the input to accept only numeric characters.

c

Explanation: The "placeholder" attribute in a text input provides a hint or example of the expected input format to the user, which is displayed in the input field before any input is provided.


How can you set the border of a select control (drop-down list) to be a solid black line?
a) border: solid 1px black;             
b) border-color: black;
c) border-style: solid;                         
d) select-border: 1px black;

a

Explanation: You can set the border of a select control (drop-down list) to be a solid black line using the CSS property "border" with the values "solid 1px black."


Which CSS property can be used to add a shadow effect to a button element in an HTML form?
a) box-shadow    
b) button-shadow
c) text-shadow                    
d) shadow-effect

a

Explanation: You can add a shadow effect to a button element in an HTML form using the CSS property "box-shadow."