HTML & CSS- part 9 Flashcards

1
Q

How do you code a form’s submit button?

A

<input type=”submit”
value=”Send email message”>

The first part creates the button that submits the form when the user clicks on it.

The “value” part is the button text. Instead of “Send email message,” it could be “Submit,” “Send,” “Subscribe,” “Purchase,” or any other text you want.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Is there an alternate to the standard submit button in a form?

A

If you want a custom button, create your own button image and write a tag like this.

<input type=”image” src=”images/subscribe-button.png” alt=”Sign up” width=”72” height=”18”>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the parts of a radio tag in the world of forms?

A

<input type=”radio”
name=”found-thru”
value=”Google” checked=”checked”> Google

*Each radio button gets its own tag.

*The NAME is what binds a group together.

*checked=”checked” This is optional. The tag that includes this will be selected by default.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In the world of forms, how do “checkboxes” work?

A

Exactly the same as “radio” except you can select more than one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What’s a select box also known as?

A

A drop-down box

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you code a select box?

A

<select name=”x”>
<option value=”cherries”>Cherries</option>
</select>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In a select box, how do you keep people from picking the default answer?

A

Assign it an option value=”did not select” or something like that.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What’s the mnemonic for remembering the code for a select box?

A

SNOV
select-name option-value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are five types of input in HTML?

A

text
textarea
submit/image submit
radio/checkbox
select box

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the fields in a text input?

A

name
rows
cols

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the fields in a submit input?

A

value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the fields in a submit input using an image?

A

src
alt
width
height

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the fields in for a radio/checkbox input?

A

name
value
(opt) checked

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which accessibility feature makes the text clickable so you don’t have to aim for just the radio button?

A

<label>
As a bonus, they cause the screen reader to read the text</label>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What sucks about using <label> in a form?

A

They have to be added individually to each field, text area, radio button, checkbox, and selection option.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you add a <label>?

A

You add a separate entry tied to an ID field in the input type code.

In this case, the ID in input type is “orange” and it’s tied to the for=”orange” in the label.

<input type=”radio” id=”orange” name=”fav_fruit” value=”HTML”>
<label for=”orange”>HTML</label>

17
Q

Which element groups related form parts in a box?

A

<fieldset>

18
Q

If you have grouped form elements in a box using <fieldset>, how do you add a title?

A

<legend>Fill out this form</legend>

19
Q

Which elements get styled with this?

form {

A

only labels and legends

20
Q

How do you style the selectors for form inputs?

A

input[type=”text”] {
input[type=”radio”] {
textarea {

21
Q

How do you set the width of a form?

A

form {
width: 50%;
}