HTML Flashcards
Where do you put non-visible content about the HTML document?
<head>
</head>
Where do you put visible content about the HTML document?
<body>
</body>
Where do the <head> and <body> tags go in a valid HTML document?
Inside <html> element
What is the purpose of a <!DOCTYPE> declaration?
Tell the browser what version of HTML you’re using.
Give five examples of HTML element types.
<title>
<head>
<body>
<p>
<img></img>
</p></body></head></title>
What is the purpose of HTML attributes?
Attributes provide additional information about the contents of an element.
Give an example of an HTML entity (escape character).
©
How do block-level elements affect the document flow?
always appear to start on a new line in the browser window.
How do inline elements affect the document flow?
always appear to continue on the same line as their neighbouring elements.
What are the default width and height of a block-level element?
Take up full width of the containing block - 100%. Height determined by content - Auto.
What are the default width and height of an inline element?
width - auto
height - auto
What is the difference between an ordered list and an unordered list in HTML?
<ol> lists where each item in the list is numbered.
<ul> lists that begin with a bullet point (rather than characters that indicate order).
</ul></ol>
Is an HTML list a block element or an inline element?
Block
What HTML tag is used to link to another website?
<a></a>
What is an absolute URL?
starts with
the domain name for that site, and can be followed by the path to a specific page. If no page is specified, the site will display the homepage.
What is a relative URL?
link to files within your own files.
How do you indicate the relative link to a parent directory?
Use ../ to indicate the folder above the current one, then follow it with the file name.
How do you indicate the relative link to a child directory?
use the name of the child folder, followed by a forward slash, then the file name.
How do you indicate the relative link to a grand parent directory?
Repeat the ../ to indicate that you want to go up two folders (rather than one), then follow it with the file name.
How do you indicate the relative link to the same directory?
just use the file name. (Nothing else is needed.)
What is the purpose of an HTML form element?
refer to different elements that allow you to collect information from visitors to your site.
Is an HTML <input></input> element a block element or an inline element?
inline
What purpose do the thead and tbody elements serve?
to show the difference from the first row and the rest of the data in the table
What are the names of the individual pieces of a CSS rule?
declaration block
property
value
Selector
In CSS, how do you select elements by their class attribute?
.selector
In CSS, how do you select elements by their tag name?
name of the element
In CSS, how do you select an element by its id attribute?
selector
Pound sign
Octothorpe
What CSS properties make up the box model?
margin
padding
border
height
width
Which CSS property pushes boxes away from each other?
margin
Which CSS property add space between a box’s content and its border?
padding
What is a pseudo-class?
a class that comes about from a special state on the page.
What are CSS pseudo-classes useful for?
user interaction and less work when loading in data.
What is the default flex-direction of a flex container?
row
What is the default flex-wrap of a flex container?
no wrap
Why do two div elements “vertically stack” on one another by default?
because they are block elements
What is the default flex-direction of an element with display: flex?
row
What are the three primary components of a page layout? (Which helper classes do you need?)
containers rows columns
What is the minimum number of columns that you should put in a row?
at least one
What is the purpose of a container?
a boundary for content
What is the default value for the position property of HTML elements?
it will move relative to where it should exist on the page
How does setting position: relative on an element affect document flow?
its removed from the document flow
How does setting position: relative on an element affect where it appears on the page?
it appears in where it normally would, or relative to it normal position based on properties set
How does setting position: absolute on an element affect document flow?
How does setting position: absolute on an element affect where it appears on the page?
appear on the page with in its nearest non static ancestor
How do you constrain an absolutely positioned element to a containing block?
set the containing block to position:relative
What are the four box offset properties?
top
What is the purpose of variables?
to store data for the future
How do you declare a variable?
var
let
const
How do you initialize (assign a value to) a variable?
=
What characters are allowed in variable names?
letters
numbers
$
_
What does it mean to say that variable names are “case sensitive”?
the same word with different capitalization will not be the same variable
What is the purpose of a string?
to hold text
What is the purpose of a number?
math
What is the purpose of a boolean?
if a state is true or false
What does the = operator mean in JavaScript?
assigns a value
How do you update the value of a variable?
name of variable = value
What is the difference between null and undefined?
null is intentionally empty
undefined usually means something i missing
Why is it a good habit to include “labels” when you log values to the browser console?
without it just prints a value with out context
What data type is returned by an arithmetic operation?
a number
What is string concatenation?
combining strings
What purpose(s) does the + plus operator serve in JavaScript?
addition or concatenation
What data type is returned by comparing two values (<, >, ===, etc)?
boolean
What does the += “plus-equals” operator do?
adds or concatenate and assigns
What are objects used for?
to store like data