HTML Flashcards
Where do you put non-visible content about the HTML document?
head
Where do you put visible content about the HTML document?
body
Where do theheadandbodytags go in a valid HTML document?
between the html tags
What is the purpose of adeclaration?
declare to the web browser the type of HTML that’s being used
Give five examples of HTML element types.
h1, p, img, a, span
What is the purpose of HTML attributes?
additional values that configure the elements or adjust their behavior
Give an example of an HTML entity (escape character).
& = ampersand © = copyright symbol ® = registered trademark symbol
How do block-level elements affect the document flow?
block-level elements always appear on a new line
How do inline elements affect the document flow?
inline elements continue on the same line as neighboring elements
What are the default width and height of a block-level element?
width = 100%, height = 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?
Ordered lists use numbers, unordered lists use bullets
Is an HTML list a block element or an inline element?
block element
What HTML tag is used to link to another website?
anchor tag <a></a>
What is an absolute URL?
the full web address for the site
What is a relative URL?
URL that only includes the path
How do you indicate the relative link to a parent directory?
../filename
How do you indicate the relative link to a child directory?
child folder/filename
How do you indicate the relative link to a grand parent directory?
../../filename
How do you indicate the relative link to the same directory?
filename
What is the purpose of an HTMLformelement?
group all form control elements, collect user input
Give five examples of form control elements.
text input, password input, text area, checkbox, radio button
Give three examples oftypeattribute values for HTMLinput elements.
text, radio, checkbox
Is an HTML inputelement a block element or an inline element?
inline
What are the six primary HTML elements for creating tables?
table, thead, tbody, tr, th, td
What purpose do thetheadandtbodyelements serve?
to specify each part of the table (head, body, footer)
Give two examples of data that would lend itself well to being displayed in a table.
listing a person and their age, day of the week and activity
What are the names of the individual pieces of a CSS rule?
selector, declaration block, property, value
In CSS, how do you select elements by theirclassattribute?
.
In CSS, how do you select elements by their type?
name of element
In CSS, how do you select an element by itsidattribute?
#
Name three different types of values you can use to specify colors in CSS.
name, hexcode, rgb
What CSS properties make up the box model?
border, margin, padding
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 keyword added to a selector that defines a special state of a selected element
What are CSS pseudo-classes useful for?
styling elements in relation to external factors, :visited :checked :hover
Name three types of units that can be used to adjustfont-sizein CSS.
px, %, rem
What CSS property controls the font used for the text inside an element?
font-family
What is the defaultflex-directionof aflexcontainer?
row
What is the defaultflex-wrapof aflexcontainer?
nowrap (all items will be in one line)
How do you center items in a container horizontally and vertically?
justify-content: center horizontally
align-items: center vertically
Why do two div elements “vertically stack” on one another by default?
divs are block elements by default
What is the defaultflex-directionof an element withdisplay: flex?
row
What is thedefaultvalue for thepositionproperty of HTML elements?
position: static
How does settingposition: relativeon an element affect document flow?
it does not affect the position of surrounding elements
How does settingposition: relativeon an element affect where it appears on the page?
it moves an element in relation to where it would have been in normal flow
How does settingposition: absoluteon an element affect document flow?
it is taken out of document flow and no longer affects the position of other elements
How does settingposition: absoluteon an element affect where it appears on the page?
it moves an element in relation to its container
How do you constrain an absolutely positioned element to a containing block?
make that element position: relative
What are the four box offset properties?
top, bottom, left, right
What is the purpose of variables?
a location to store data for the future
How do you declare a variable?
var + name of variable = value;
How do you initialize (assign a value to) a variable?
=
What characters are allowed in variable names?
letters, numbers, dollar sign, underscore
What does it mean to say that variable names are “case sensitive”?
different casing for variables are unique
What is the purpose of a string?
to store text
What is the purpose of a number?
for representing mathematical values
What is the purpose of a boolean?
to represent a choice of yes or no( true or false)
What does the = operator mean in JavaScript?
for assigning values
How do you update the value of a variable?
assign the variable another value
What is the difference between null and undefined?
null is when something is intentionally set to an empty value, undefined is when something has not been assigned a value
Why is it a good habit to include “labels” when you log values to the browser console?
easier to identify what the values mean
Give five examples of JavaScript primitives.
string number boolean undefined null
What data type is returned by an arithmetic operation?
number
What is string concatenation?
combine two strings into one string
What purpose(s) does the + plus operator serve in JavaScript?
addition of numbers and concatenation of strings
What data type is returned by comparing two values (, ===, etc)?
boolean
What does the += “plus-equals” operator do?
i += 1 equates to i = i + 1;
What are objects used for?
grouping together a set of variables/functions to create a model
What are object properties?
a variable that’s a part of an object
Describe object literal notation.
var object = { property1: value, property2: value, property3: value };
How do you remove a property from an object?
delete object.property;
What are the two ways to get or update the value of a property?
dot notation and bracket notation
What are arrays used for?
to store a collection of data in an orderly fashion
Describe array literal notation.
var arr = [ ];
How are arrays different from “plain” objects?
objects have no order, objects have properties associated with their values
What number represents the first index of an array?
0
What is the length property of an array?
how many pieces of data are stored in the array
How do you calculate the last index of an array?
array.length - 1
What is a function in JavaScript?
repeatable named block of code that does a specific job