HTML Flashcards

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
Q

What is the difference between the “get” method and the “post” method when taking in values from a form?

A
  • 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
Q

What are the six primary HTML elements for creating tables?

A

td, tr, th, thead, tbody, tfoot

27
Q

What purpose do the thead and tbody elements serve?

A
  • semantic descriptor
  • apply different stylistic elements
  • assist screen readers
  • in some browsers, thead elements stay visible while the tbody elements scroll
28
Q

Give two examples of data that would lend itself well to being displayed in a table.

A

financial data, TV schedules, sports results, stock reports, timetables

29
Q

What is a client?

A

a computer or program that accesses a service made available by a “server”

30
Q

What is a server?

A

a computer or program that provides functionality for “clients”

31
Q

Which HTTP method does a browser issue to a web server when you visit a URL?

A

HTTP GET request

32
Q

What three things are on the start-line of an HTTP request message?

A
  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
Q

What three things are on the start-line of an HTTP response message?

A
  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
Q

What are HTTP headers?

A
  • all the text from a HTTP request/response that comes after the request line
  • (kind of like the header in an html document)
35
Q

Is a body required for a valid HTTP request or response message?

A

-no, some methods don’t have a response body (HEAD)

or when the response is just 404 Not Found

36
Q

What is AJAX?

A

a technique for loading data into part of a page without having to refresh the entire page

37
Q

What does the AJAX acronym stand for?

A

Asynchronous JavaScript And XML

38
Q

Which object is built into the browser for making HTTP requests in JavaScript?

A

XHR object

39
Q

What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?

A

load event

40
Q

An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?

A

they both share an object in the prototypal chain