HTML & CSS- part 8 Flashcards

1
Q

Tables sometimes put spaces between the cells. You may only notice this if you’re using a border.

How do you get rid of these spaces?

A

table {

border-collapse: collapse;

}

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

How do you add spaces between each cell, whether or not there are visible borders?

A

table {
border-spacing: 3m;
}

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

What’s the difference between setting the width for <table> and the width for <th> or <td>?

A

For <table>, the percentage is of the WHOLE PAGE OR DIV

But for <th> or <td>, the percentage is of the TABLE, not the page/div.

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

What are the options for horizontal alignment in a table? (Or elsewhere)

A

text-align: left, right, center, justify;

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

What are the options for vertical alignment in a table?

A

vertical-align: top, center, bottom;

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

Which kind of element does vertical-align not work in?

A

<table>
Instead, you have to do it direcdtly for <th> and <td>

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

What’s the default horiz. alignment for <td>?

A

<td> default alignment is left

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

What’s the default horiz. alignment for <th>?

A

<th> default alignment is center

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

What’s the default vertical alignment for both <td> and <th>?

A

Vertical alignment default for both <td> and <th> is center

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

What’s a nice way to make the rows stand out?

A

background-color:

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

What are the attributes of a <form> tag?

A

action
method

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

In a <form> tag, what does the attribute “action” do?

A

“action” tells the browser what to do with the info typed into the form.

In the case of “send-email.php”, this might send an email to the site owner that includes the data the user has entered.

Or a program might write the data entered by the user to a database on the server.

Or a program might process credit card information entered in a form.

There are all kinds of programs, written in various languages, that can process data from a form. The languages include PHP, Ruby, Python, Perl, Java, and C#.

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

In a <form> tag, what does the attribute “method” do?

A

Indicates HOW to process the information from the form

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

What are the two options for “method” in a <form> tag?

A

method=”post”

This is the one you use to process more than a little bit of information

Use it when you want to keep the information secure.

method=”get”

This is used mostly for search forms.

You know a form is using the get method when the information entered in the form (connected by plus signs) appears in the URL after you click Submit.

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

What’s the basic structure of a <form> tag with its controls?

A

<form>

form elements such as
text
textarea
submit buttons,
radio buttons
checkboxes
select box, etc.

</form>

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

In the world of <form>, what is the input type “text”?

A

one single-line text field

17
Q

When coding a form input type, how do you code the controls? With a colon? An equals sign? Quotes?

A

Controls in forms are coded with an equals sign and double quotes:

<input type=”text” name=”surname” size=”25” maxlength=”40”>

18
Q

In the form input type “text”, what are the parts and what are their purposes?

A

type= either “text” or “password”

name= tells the program that’s processing the data what to call the information that the user enters in that field.

size= width in characters of the input form. Optional. Defaults to 20.

maxlength= how long the input data can be. Optional. Defaults to unlimited characters.

19
Q

In the world of <form>, what is the input type “textarea”?

A

a multi-line text box.

20
Q

Is the form input type “textarea” an open or closed tag?

A

Closed:

<textarea>
</textarea>

21
Q

In the form input type “textarea”, what are the parts and what are their purposes?

A

name= tells the program that’s processing the data what to call the information that the user enters in that field.

rows= number of rows*

cols= number of columns**

closing tag= </textarea>

\ <textarea></textarea>

*By default, entered text will scroll if the user types beyond the specified number of rows.

**By default, the field can be resized by the user when she drags the lower-right corner with the mouse.