HTML Flashcards

(40 cards)

1
Q

Where do you put non-visible content about the HTML document?

A

in the head

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

Where do you put visible content about the HTML document?

A

in the body

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

Where do the head and body tags go in a valid HTML document?

A
  • head is the first thing that comes after the html tag

- body goes after the head

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

What is the purpose of a !DOCTYPE declaration?

A

lets the browser know what version of HTML the page is written in

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

Give five examples of HTML element tags.

A

head, body, p, h1, h2, h3

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

What is the purpose of HTML attributes?

A

changes or adds more information to the html element

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

Give an example of an HTML entity (escape character).

A

< > & ‘’”” copyright, trademark, etc.

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

How do block-level elements affect the document flow?

A

takes up 100% width (the whole line)

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

How do inline elements affect the document flow?

A

takes up however much horizontal space it takes

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

What are the default width and height of a block-level element?

A
  • width 100%

- height: auto (however much vertical space it takes)

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

What are the default width and height of an inline element?

A
  • width: auto (however much horizontal space it takes)

- height: auto (however much vertical space it takes)

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

What is the difference between an ordered list and an unordered list in HTML?

A
  • ordered list is numbered

- unordered list uses bullet points

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

Is an HTML list a block element or an inline element?

A

-block

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

What HTML tag is used to link to another website?

A

<a></a>

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

What is an absolute URL?

A

the full page address of a webpage or web file

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

What is a relative URL?

A

uses a file path to link to a file in the same relative location as the root file

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

How do you indicate the relative link to a parent directory?

A

../parent.html

18
Q

How do you indicate the relative link to a child directory?

A

child-folder/child.html

19
Q

How do you indicate the relative link to a grand parent directory?

A

../../grandparent.html

20
Q

How do you indicate the relative link to the same directory?

A

file-name.html

21
Q

What is the purpose of an HTML form element?

A

sets up the boundary that allows the user to submit data to the server

22
Q

Give five examples of form control elements.

A

text/password input, text area, radio/submit button, select, option, file upload, drop-down boxes

23
Q

Give three examples of type attributes for HTML “input” elements.

A

text, password, radio, checkbox, file, submit, image, hidden

24
Q

Is an HTML “input” element a block element or an inline element?

A

inline element

25
What is the difference between the "get" method and the "post" method when taking in values from a form?
- get: values from the form are added to the end of the URL specified in the "action" attribute. mainly used for short forms (search boxes) - post: values are sent in HTTP headers. used to allow users to upload a file, or if the form is very long/contains sensitive data/adds or deletes information from a database
26
What are the six primary HTML elements for creating tables?
td, tr, th, thead, tbody, tfoot
27
What purpose do the thead and tbody elements serve?
- semantic descriptor - apply different stylistic elements - assist screen readers - in some browsers, thead elements stay visible while the tbody elements scroll
28
Give two examples of data that would lend itself well to being displayed in a table.
financial data, TV schedules, sports results, stock reports, timetables
29
What is a client?
a computer or program that accesses a service made available by a "server"
30
What is a server?
a computer or program that provides functionality for "clients"
31
Which HTTP method does a browser issue to a web server when you visit a URL?
HTTP GET request
32
What three things are on the start-line of an HTTP request message?
1. an HTTP method, a verb (GET/PUT/POST), or a noun (HEAD/OPTIONS) that describes the action to be performed 2. the request target, usually a URL 3. the HTTP version ex. GET https://example.com/ HTTP/1.1
33
What three things are on the start-line of an HTTP response message?
1. the protocol version (usually HTTP/1.1) 2. a status code that indicates success or failure (202, 404, 302, ...) 3. a status text that explains the status code
34
What are HTTP headers?
- all the text from a HTTP request/response that comes after the request line - (kind of like the header in an html document)
35
Is a body required for a valid HTTP request or response message?
-no, some methods don't have a response body (HEAD) | or when the response is just 404 Not Found
36
What is AJAX?
a technique for loading data into part of a page without having to refresh the entire page
37
What does the AJAX acronym stand for?
Asynchronous JavaScript And XML
38
Which object is built into the browser for making HTTP requests in JavaScript?
XHR object
39
What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?
load event
40
An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?
they both share an object in the prototypal chain