Week 5 Flashcards

1
Q

What is HTML?

A

HTML stands for Hypertext Markup Language and consists of various tags to describe the content of a document - utilized as the basis for all web pages, along with CSS and JavaScript

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

What is the structure of an HTML document? List some tags. What is used for? ?

A

Start with the doctype declaration, then , then and . The head contains the metadata for the page, while the body contains the content that is rendered to the screen.

Other tags: div, span, p, ul, ol, li, strong, em, table

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

What is a doctype?

A

First tag in the document - defines what type of file it is - whether html 4 or 5, etc

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

What is the tag for an ordered list? Unordered list?

A

ordered list: ol, unordered list: ul. Both use li - list items

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

What are some HTML5 tags? Why were HTML5 tags introduced?

A

HTML5 introduced semantic tags to more accurately reflect the content of the tags. Examples: <strong> instead of <b>, <em> instead of <i>, , , , , , and instead of reusing <div> tags everywhere</div></i></em></b></strong>

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

Do all tags come in a pair? What are the other things inside tags called? list some.

A

No - tags either have a closing tag or are self-closing (). Attributes are contained within tags - examples: id, class, style, height, width, etc

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

What is the syntax for a comment in HTML?

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

What are some tags you would use in a form?

A

, , , , , ,

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

What is CSS?

A

CSS stands for Cascading Style Sheets - it is a language for styling HTML documents by specifying certain rules for layout and display in key/value pairs.

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

what are the different ways of styling an HTML file? Which is best? why?

A

(1) inline - in the style attribute
(2) internal stylesheet - in the tag in the
(3) external stylesheet - using external .css file, use in the
External stylesheet is best practice due to separation of concerns, reusability, modularity

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

Describe the CSS box model.

A

The box model consists of margin (outermost box), then border, then padding, then content (innermost). All box sizes / formatting can be styled with CSS

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

Which way has highest priority when styles cascade: inline, internal, and external.

A

Inline has highest priority, then internal/external depending on order. Cascading rules are determined by (1) importance (!important flag), (2) specificity of selector (inline has no selector, highest specificity), then (3) source order.

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

Syntax for styling an element? What is a class and how to style them? What is an id? how to style? difference?

A
div {
  property: value;
}
.class {
  property: value;
}
#id {
  property: value;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What if I want to select child elements, What syntax is that?

A

use direct descendant selector (>) or space for any level nested element

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

Can I select multiple elements at once? How?

A

yes, with a comma

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

What is JavaScript? What do we use it for?

A

JavaScript is the most commonly used client-side scripting language. It is a high-level, multi-paradigm, interpreted programming language used to create dynamic webpages. When the browser loads a webpage, the browser interprets javascript code in it and executes it.

17
Q

Can we run JavaScript in a web browser, on a server, or both?

A

Browser.

18
Q

What are the benefits of JS over your core language? Drawbacks?

A

Speed, simplicity, Interoperability, Rich user intefaces.

Not secure. can only run in browsers, some browsers will interpret differently.

19
Q

What is the type of NaN? What is the isNaN function?

A

In JS, NaN is a number that is not a legal number.

20
Q

What are the data types in JS?

A
string
number
boolean
null
undefined
object
Symbol
21
Q

What are JS objects? What is the syntax, create an empty object called empty.

A

In JS, an object is an unordered collection of key-value pairs. Each key-value pair is called a property.

let empty = {}

22
Q

What are arrays in js? can you change their size?

A

array in js can hold many values under a single name, and you can access the values by referring to an index number. use const keyword.

Yes. use the length property.

23
Q

What are array methods?

A

functions built into javascript that we can apply to our arrays.

24
Q

What does the map() method do?

A

This method creates a new array with the results of calling a provided function on every element in this array.

25
Q

What does the filter() method do?

A

This method creates a new array with only elements that passes the condition inside the provided function.

26
Q

What does the forEach() method do?

A

This method helps to loop over array by executing a provided callback function for each element in an array.

27
Q

What is JSON?

A

JavaScript Object Notation.

Used when data is sent from a server to a web page.