Intro to HTML Flashcards

1
Q

POST method

A

The query string appears in the HTTP request body when the form submits data with the POST method.

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

What is the difference between the POST and GET method?

A

GET - The name=value pairs are sent through the URL and there are data amount limitations

POST - The name=value pairs are sent more securely by not showing them in the URL

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

What is the tag for comments?

A

<!-- -->

Ex. <!-- Example -->

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

Table structure

A

<table>
<tr>
<th></th> (or <td></td>)
<th></th>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>

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

What does the <form> element do?

A

The <form> element allows the web browser to submit information from the user to the server.

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

Query string

A

Query string is a set of name=value pairs separated by the ampersand character (&).

Example:
<form — type=”text” name=”first” id=”first”>

<input — type=”text” name=”last” id=”last”>
The query string would be first=John&last=Smith

Each “name” is specified as an attribute of the HTML field, and the “value” is the user-entered data, i.e., John Smith.

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

GET method

A

The GET method submits information to a web server by altering the URL of the HTTP request.

  1. Creates a query string.
  2. Creates an URL with the server page and name=value pairs that’s separated by a question mark. (http://example.com/apply?first=John&last=Smith
  3. Uses the newly created URL to create and send an HTTP GET request.
  4. Displays or updates the webpage using the HTTP response received from the server.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the required attributes for the <form>?

A

Action - Tells the browser where to send the form data. The action to be performed when the form is submitted.

Method - Indicates the HTTP request type the browser will use to communicate with the server using either “GET” or “POST” (GET being the default).

form — action=”Website” method=”POST”

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

enctype attribute

A

If a form field contains binary data such as an image, a POST request is split into multiple parts.

The <form> element’s enctype attribute value “multipart/form-data” indicates the web browser should split a POST request into multiple parts, where each input field is sent as a separate part of the HTTP request message.

<form — action=”website” method=”POST” enctype=”multipart/form-data”>

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

escaped and unescaped

A

Escaped - Encoded data that replaces special characters with codes that represent them to be correctly understood by the server.

Special characters are represented by a percent sign “%” followed by two hexadecimal digits that represent the character’s ASCII value.

Ex: “1 + 2 = ?” is “1+%2B+2+%3D+%3F”.

The “+” represents a space, 2B is the ASCII hex value for “+”, 3D is the ASCII value for “=”, and 3F is the ASCII value for “?”

Unescaped - The server determine what the original values of the data are.

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

widget

A

A widget is an interactive component (usually graphical) that the browser uses to interact with a user.

Ex: Buttons, drop-down menus, and data entry fields.

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

The “input” tag’s 5 attributes and their purpose.

A

The <input></input> element is a void element with five primary attributes:

type attribute - indicates the widget type. (text, password, submit, and button).

name attribute - names the widget and sends the widget’s value when the widget’s form is submitted.

id attribute - used to give a widget a unique identifier.

placeholder attribute - specifies text that first appears in a text widget, typically for giving the user a hint as to the expected value.

value attribute - specifies a default value for a widget.

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

text box

What tag does it belong to?

A

A text box widget is an <input></input> element with the attribute of type=”text” that allows users to enter a single line of text.

<input - type=”text” name=”status” id=”status” placeholder=”Your status”>

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

submit button

What element does it belong to?

A

The web browser displays a submit button widget for an <input></input> tag with the attribute of type=”submit”. A submit button uses the value attribute to specify the button’s text.

<input - type=”submit” value=”Send status”>

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

“label”

What is it’s attribute?

A

The “label” tag displays descriptive text associated with a specific widget.

A label has a “for” attribute whose “value” should match the “id” attribute for the widget being labeled.

Labels help people using screen readers understand what input is expected.

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

What is a “textarea” tag and what attributes belong to it?

A

A “text area” widget allows users to enter multiple lines of text.

It is a void element.

Optional attributes are “rows” and “cols” to specify the size of the text area.

<textarea - row=”2” cols=”6”>

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

Which attribute in the “input” tag should the “for” attribute match in the “label” tag?

A

The “for” attribute of the “label” tag should be equal to the “id” attribute of the “input” element to bind them together.

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

What does the value attribute do on a button?

A

The “value” attribute defines the text displayed on the button.

<input - type=”submit” value=”Submit Form”>

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

What code makes a checkbox initially appear selected?

A

<input - type=”checkbox” checked>

Ex.
<input - type=”checkbox” id=”birthday_today” name=”birthday_today” checked>

Sent to server as birthday_today=on

If there is no “value” attribute then the value defaults to “on”.

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

radio button

A

A radio button is a widget that allows users to select exactly one value from possibly many values.

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

Basic HTML page structure before adding content.

A

<!DOCTYPE html>

<html>
<head>
<meta - charset="UTF-8">
<title>Stephanie's Practice Page</title>
</head>
<body>
</body>
</html>

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

meta tag

A

<meta - charset=”UTF-8”>

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

What attribute changes ordered lists numbering style and unordered lists bullet point styles?

A

<ol - type =”A”>
<ol - type=”i”>

<ul - style=”list-style-type:square”>

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

favicon images

A

A favicon is a small icon that identifies a website and typically displays in a browser tab.

<link - rel=”icon” href=”favicon.png”>

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

Absolute vs. Relative URLs

A

An absolute URL is a complete URL.

Ex: <a - href=”http://example.com/test.html”>test</a>

A relative URL specifies the relative path to the web resource with no scheme or hostname.

Ex: <a - href=”test.html”>test</a>

22
Q

fragment identifier

A

A fragment identifier is a part of a URI that points to a specific section within a web page. It’s essentially a bookmark within a URL.

https://en.wikipedia.org/wiki/Computer_science#History

Refers to the “History” section of the “Computer_science” page on Wikipedia.

Code Ex.

<p>
Links to chapters:
<a - href="#Ch1">Chapter 1</a>
</p>

section id=”Ch1”

<h2>Chapter One</h2>

/section

23
Q

target attribute

A

An <a> element’s “target” attribute indicates how the browser should display the link when clicked.</a>

target=”_self” attribute value is the default and indicates the browser will open the link in the same tab or window.

target=”_blank” attribute value indicates the browser will open the link in a new tab or window.

24
Q

mailto scheme

A

Ex: <a - href=”mailto:caleb@gmail.com”>

25
Q

Emoji

A

Emoji characters can be displayed in a webpage with a decimal or hexadecimal entity.

Ex: The 😀 emoji can be displayed with &#128512

Since emoji are characters, not images, emoji characters can also be copied and pasted into any HTML document.

Ex: <p>🥰</p>.

26
Q

entity

A

An entity is a mechanism for writing special characters or symbols in HTML

The copyright symbol could be one of the following using either the entity name, decimal, or hexadecimal: (edit flashcard to see code)
©
©
©

27
Q

Non-breaking characters

A

A non-breaking character is an inter-word character that doesn’t show up on the same line together, i.e., half-time.

“non-breaking hyphen” , looks like a regular hyphen

Ex: offcampus displays “off‑campus” on the same line

“non-breaking space”, , looks like a single space but acts like a normal character in the middle of a word.

Ex: 5 km displays “5 km” on the same line.

28
Q

container

A

A container is any element that has opening and closing tags.

Ex.
The <ol> element is the parent container for all list items.

Each <li> element is the container for one list item.

29
Q

parent container

A

A parent container is the container in which another element resides.

Ex.
The <ol> element is the <li> element’s parent container

30
Q

checkbox

A

A checkbox is a widget for <input></input> elements with the type attribute of “checkbox” (type=”checkbox”), which allows users to check, or select, a value.

For each checkbox selected, the browser sends the checkbox’s name and value to the server. If a checkbox is not selected, the browser does not send anything to the server.

If checked, the name=value is sent to the server in the form of name=on. “On” being the value because the checkbox was checked.

31
Q

boolean attribute

A

A boolean attribute is an attribute that is true when present and false when absent. No value must be assigned to a boolean attribute.

Ex.
<input - type=”checkbox” checked>

32
Q

radio button

A

A radio button is a widget for “input” elements with the attribute type=”radio”, which allows users to select exactly one value from possibly many values.

The web browser groups radio buttons together with the same name attribute, where each possible value in a group has an associated input.

Ex.
“input type=”radio” name=”movie” value=”ET””

33
Q

drop-down menu element and attribute

A

The <select> element creates a drop-down menu</select>

The <option> element creates a value, or option, the user can select within a drop-down menu.</option>

Ex.
<select - name=”sport”>
<option - value=”football”>Football</option>
<option - value=”soccer”>Soccer</option>
</select>

This code would create a drop-down menu with the option of either Football or Soccer.

34
Q

list box

A

Displays a list of options, usually in a box with a scrollbar, and more than one option can be selected.

A list box widget is created by specifying a size with the “select” element’s “size” attribute.

Ex: Creates a list box that shows four options at a time: select size=”4”

The “multiple” attribute allows the user to select multiple options.

35
Q

button widget

A

A button widget can be created using the “button” element and has words on it like:
Submit
Login
Share

36
Q

password attribute and additional attributes that can be used with it

A

type=”password”

Password contents don’t displayed on-screen.

<input - type=”password” name=”secret” size=”10” maxlength=”10”>

37
Q

“fieldset” and
“legend” elements

A

The “fieldset” element groups related form widgets together and draws a box around the related widgets.

The “legend” element defines a caption for a “fieldset”.

<fieldset>
<legend>Favorite Sitcom</legend>

<input - type="radio" name="sitcom" value="The Office" id="theOffice">
<label - for="theOffice">The Office</label>
</fieldset>

Any type of widget can be grouped in a <fieldset>. Fieldsets and legends benefit individuals that use assistive technologies like screen readers. CSS can be used to remove the rectangle if desired.

38
Q

input picker

A

An input picker is a widget that allows the user to interactively pick a choice using a popup or other guided selection method.

39
Q

What is a date picker and what are its attributes?

A

The date picker is an input picker that allows the user to enter a date or choose a date from a calendar popup.

<input - type=”date”>

Attributes are “min” (the earliest date permitted) and “max” (the latest date permitted).

40
Q

color picker

A

Clicking on the color picker creates a color selector popup that helps the user explore and choose a color.

<input - type=”color”>.

41
Q

number input and its attributes

A

The “number” input ensures user input is a valid number.

<input - type=”number”>

The “min” and “max” attributes are commonly used with the number input.

42
Q

range input widget and its attributes

A

The range input widget allows the user to select a value by dragging a sliding control along the length of a line.

<input - type=”range”>

Three commonly used attributes for the range input are “min”, “max”, and “value”.

43
Q

combo box

A

A combo box is the combination of a text box and drop-down menu into a single widget.

A combo box is created with an “input” element, which creates the text box, and a “datalist” element, which provides the drop-down list options. The datalist lists all the list options. The user can quickly choose an option by typing part of the option, then selecting the option from the list of matching options.

<input - list=”sport”>

datalist - id=”sport”
<option - value=”Baseball”>
<option - value=”Basketball”>
<option - value=”Football”>
<option - value=”Hockey”>
<option - value=”Soccer”>
/datalist

44
Q

List the 4 specialized text input.

A

url - For typing a URL
tel - For typing a telephone number
email - For typing an email address
search - For typing search terms

Ex,
<input - type=”tel” placeholder=”(###) ###-####”>

<input - type=”email” placeholder=”name@domain.com”>

45
Q

required attribute

A

States that the input is required and must not be left empty.

<input - type=”password” required>

46
Q

fallback

A

A fallback is a mechanism that allows a webpage element to function correctly even if the browser does not support a particular element.

47
Q

polyfill

A

A polyfill is a fallback using JavaScript code that makes certain HTML features work on browsers that do not natively support those features. Developers often use a JavaScript library such as Modernizr to detect which features the browser does not support, and then load one or more polyfills to provide fallback mechanisms for the non-supported features.

48
Q

Audio element
What element is inside of it, and what are the 4 attributes, and what do they do?

A

The “source” element is used inside the “audio” element to specify an audio file to play. Different web browsers support different audio formats, so multiple “source” elements can be used to supply alternate file formats.

Attributes (all of which are Boolean include:
autoplay - makes the audio begin playing automatically.

controls - displays audio controls for the user to play, pause, and control the volume.

loop - replays the audio upon reaching the end of the audio.

muted - initially mutes the audio.

Ex.

<audio>
</audio>

49
Q

“video” element
What element is used within it and what are its attributes?

A

The “source” element is used in a “video” element to specify the name of the video file to play. Some common <video> attributes include:</video>

Attribute (all boolean):
autoplay - makes the video begin playing automatically.

controls - displays video controls for the user to play, pause, and control the volume.

loop - replays upon reaching the end of the video.

muted - initially mutes the video.

width - Specifies the pixel width of the video’s display area.

Some browsers will not autoplay a video unless the video is muted. Ex: “video autoplay muted” will play a muted video in all browsers.

50
Q

“iframe” element

A

The “iframe” element allows a webpage to be embedded in a rectangular area of the current webpage. The “iframe” element uses the “src” attribute to specify the URL of the webpage to display and the “width” and “height” attributes to define the width and height in pixels of the rectangular iframe.

Ex.
“iframe width=”460” height=”250” src=”https://www.youtube.com/embed/7g7kP_Trp0g?rel=0””
“/iframe”

A YouTube video may be embedded in a webpage with the <iframe> element.

51
Q

script element

A

The “script” element allows a webpage to include code that the browser assumes is JavaScript.

The optional type attribute specifies the content type when the content is not JavaScript.

The src attribute provides the URL of an external file containing JavaScript code. If a “script” element does not have the src attribute, then the JavaScript code is contained directly within the element.

“script src=”https://example.com/interactive_content.js””
“/script”

The contents within the

 and <style> elements are not displayed by the browser. The 
 and <style> elements' purpose is to provide interactive functionality and presentational styling.</style>
</style>
52
Q

“style” element

A

The “style” element allows the webpage to introduce presentational directives, usually CSS.

A “style” element is placed in an HTML document’s “head” element because the style’s CSS is designed to describe the presentation of the entire document.

The contents within the

 and <style> elements are not displayed by the browser. The 
 and <style> elements' purpose is to provide interactive functionality and presentational styling.</style>
</style>
53
Q

header element

A

The <header> element represents a container for introductory content or a set of navigational links.

A <header> element typically contains:
one or more heading elements (<h1> - <h6>)

logo or icon

authorship information

Note: You can have several <header> elements in one HTML document. However, <header> cannot be placed within a <footer>, <address> or another <header> element.

54
Q

footer

A

The <footer> element defines a footer for a document or section.

A <footer> element typically contains:

authorship information
copyright information
contact information
sitemap
back to top links
related documents
You can have several <footer> elements in one document.

55
Q

The <nav> element defines a set of navigation links.

A

The <The <nav> element defines a set of navigation links.> element defines a set of navigation links.

56
Q

The <aside> element defines some content aside from the content it is placed in (like a sidebar).

A

The <The <aside> element defines some content aside from the content it is placed in (like a sidebar).> element defines some content aside from the content it is placed in (like a sidebar).