Front End Flashcards
Inline vs inline-block
Inline-block allows us to set width and height as if the element was of block display. Inline elements don’t have this ability
What must an element have in order for margin: auto; to work?
It must have a set width
What is an element’s default position?
Static
If an element is given position: relative; what is it relative to?
Its default static position
What does confirm(“whatever”) return?
A boolean
What does prompt(“question”) return?
A string
What does alert(“message”) return?
nothing
If the script tag is in the head how do you make it work?
You add the keyword defer
How do you select the immediate p child of a div?
div > p this is called a child combinator
How do you select a p that is next to a div?
div + p this is called an adjacent sibling combinator
How do you select all even li?
li:nth-child(even)
What does git clean -xdf do?
Removes files not tracked by git (I think)
How do you select all p siblings of a div?
div ~ p General sibling combinator
How do you select list items with a class of “a” which are direct children of a <ul>?
ul > li[class=”a”]
What’s the difference between parseInt() and Number()?
parseInt() evaluates the argument upto the first non digit character in the string passed in. Number takes the whole argument and tries to convert that. Also parseInt takes the radix as the second argument
What are pseudo classes?
They are keywords added to a selector; ex. a:hover that specify a special state