HTML & CSS- part 8 Flashcards
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?
table {
border-collapse: collapse;
}
How do you add spaces between each cell, whether or not there are visible borders?
table {
border-spacing: 3m;
}
What’s the difference between setting the width for <table> and the width for <th> or <td>?
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.
What are the options for horizontal alignment in a table? (Or elsewhere)
text-align: left, right, center, justify;
What are the options for vertical alignment in a table?
vertical-align: top, center, bottom;
Which kind of element does vertical-align not work in?
<table>
Instead, you have to do it direcdtly for <th> and <td>
What’s the default horiz. alignment for <td>?
<td> default alignment is left
What’s the default horiz. alignment for <th>?
<th> default alignment is center
What’s the default vertical alignment for both <td> and <th>?
Vertical alignment default for both <td> and <th> is center
What’s a nice way to make the rows stand out?
background-color:
What are the attributes of a <form> tag?
action
method
In a <form> tag, what does the attribute “action” do?
“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#.
In a <form> tag, what does the attribute “method” do?
Indicates HOW to process the information from the form
What are the two options for “method” in a <form> tag?
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.
What’s the basic structure of a <form> tag with its controls?
<form>
form elements such as
text
textarea
submit buttons,
radio buttons
checkboxes
select box, etc.
</form>
In the world of <form>, what is the input type “text”?
one single-line text field
When coding a form input type, how do you code the controls? With a colon? An equals sign? Quotes?
Controls in forms are coded with an equals sign and double quotes:
<input type=”text” name=”surname” size=”25” maxlength=”40”>
In the form input type “text”, what are the parts and what are their purposes?
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.
In the world of <form>, what is the input type “textarea”?
a multi-line text box.
Is the form input type “textarea” an open or closed tag?
Closed:
<textarea>
</textarea>
In the form input type “textarea”, what are the parts and what are their purposes?
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.