Coding FlashCards
Give five examples of HTML element tags.
- html
- head
- title
- body
- p tag
What is the purpose of HTML attributes?
are a modifier of an HTML element type
Give an example of an HTML entity (escape character)
” © “ = copyright
How do you indicate the parent folder in a path?
Use ../ to indicate the folder above the current one, then the file name
Example: ../index.html
How do you indicate the child folder in a path?
Use the name of child folder, then the file name
Example: music/listings.html
How do you indicate the grand parent folder in a path?
Repeat the ../ to go up two folders, then follow with the file name.
Example: ../../index.html
How do you indicate the current folder in a path?
Use the file name
Example: index.html
–
What purpose do the thead and tbody elements serve?
thead: separate chunks in your table (table header)
tbody: the body (information) of table
Give two examples of data that would lend itself well to being displayed in a table.
Numbers, finances, anything you can put in an excel sheet
What is an absolute URL?
What is a relative URL?
Absolute URL: When you link to a different website, the value of the href attribute will be the full web address for the site
Relative URL: When you are linking to other pages within the same site, you do not need to specificy the domain name in the URL (example: Home)
–
What attribute do you have to match between a label and an input?
for and id
What type of input allows you to select multiple items in a dropdown?
select
select needs to work with the element
What does the element do?
uses the action attribute to indicate the page that the data is being sent to
What does the element do?
indicates the purpose of each form control
Give three examples of type attributes for HTML elements.
type
id
value
Give three examples of type attributes for HTML elements.
password email radio checkbox text calendar phone number button color date time file
Why would we choose specific element types when we have elements such as div and span which can be used for anything?
Provide elements that provide content
SEO (search englines)
Accessibility
What factors contribute to a well-designed HTML document?
Proper formatting (indenting)
Using the correct functions
What are the names of the individual pieces of a CSS rule?
property, value, selector, declaration
How are key/value pairs related to CSS?
properties and values
name that correlates to a value
Name three different types of values you can use to specify colors in CSS.
RBG Values
HEX
Color Names
Why must you have backup fonts assigned when selecting custom fonts?
In case the user does not have that font installed
If the fall back doesn’t work, it will default to New Times Roman
What CSS properties make up the box model?
padding, border, margin
content is not a CSS property
Which CSS property pushes boxes away from each other?
margin
Which CSS property pushes box content away from its border?
padding
What are three important considerations for choosing fonts?
Readability, cross browsers reading, theme, target market
In what situations might you need to apply styling to a single element multiple times in one stylesheet?
Mobile responsiveness
What is source order?
order that CSS rule is written
Styling provided for an element LAST in stylesheet
What is inheritance?
If the child element does not have a value, it would look to the parent element for a value
Why might CSS include this feature?
To set font related properties instead of setting it individually
Is inheritance a good tool to use for styling? If so, on what occasions?
Yes, because you can simplify setting properties
although its on the weaker side - any direct styling will override it
When is ! important a good tool to use?
NEVER. It’s used to override a template that you have no control over or for people writing libraries for CSS
What is specificity?
A browser decide which CSS property values are the most relevant to an element.. then apply it
The more unique, the stronger it’ll be
How is specificity calculated?
determined by the number of each selector type in the matching selector
Why might CSS include this feature?
To make things more precise to an element and not worrying about it getting overwritten
What is the order of selector strengths for CSS specificity (commonly referred to as the Specificity Hierarchy)?
id
class
element
universal selector
What is the CSS Cascade?
All the factors to determine what style is applied
What are CSS pseudo-classes useful for?
adds a specific selector to an element
What is the difference between the :first-child pseudo selector and the :last-child pseudo selector?
allows you to visually manipulate an element by skewing, rotating, translating, or scaling:
What does the transform property do?
allows you to visually manipulate an element by skewing, rotating, translating, or scaling:
What is the difference between the :first-child pseudo selector and the :last-child pseudo selector?
The :first-child CSS pseudo-class represents the first element among a group of sibling elements.
The :last-child CSS pseudo-class represents the last element among a group of sibling elements.
What are 3 examples of what can be done with CSS transitions?
duration, timing, and delay
Are all properties able to be transitioned?
yes
Why is CSS transition a useful tool?
create elements to be more visually pleasing
another way to make website more comfortable for users
How do block-level elements affect the document flow?
start on a new line in the browser window
examples: h1, p, ul, li
How do inline elements affect the document flow?
some elements will continue on the same line as neighboring elements
examples: a, b, em, img
What are the default width and height of a block-level element?
100% (takes up any space available)
height: auto (same as content)
width: 100%
What are the default width and height of an inline element?
takes up space to accommodate its contents
height: auto (same as content)
width: auto (same as content)
What accessibility considerations must be considered when choosing HTML elements?
when you want emphasize through a spoken word (such as strong, em, del)
What is the difference between display: none and visibility: hidden?
display: none = hides an element on a page.. element will not be on the page at all (no spaces, no gaps)
visbility: hidden = hides an element.. all the other elements moves over it (shows a space for the hidden element)
What is the difference between the block, inline block, and inline display properties?
block: takes up full width
inline: takes up minimum space
inline block: takes up minimum space but with a set height and width
What is the initial display property of div s?
block
What is the difference between the block, inline block, and inline display properties?
block: takes up full width
inline: takes up minimum space
inline block: takes up minimum space but with a set height and width (you can resize height and width)
Why are CSS resets helpful for cross browser compatibility?
its good to be consistent across multiple browsers
Why is it important to be mindful of what you reset with your CSS resets?
you don’t want to reset everything as it’ll give us a starting point. you just want to get rid of things that will cause problems between different browsers
What is an argument against using CSS resets?
a lot of the styles are eventually overridden by our main stylesheet, which means that the reset styles unnecessarily add to page load time
What is an argument against using CSS resets?
a lot of the styles are eventually overridden by our main stylesheet, which means that the reset styles unnecessarily add to page load time (more work for browser)
What is the default value for the position property of HTML elements?
Position default = Static
How does setting position relative on an element affect document flow and where the element appears on the page?
moves an element in relation to where it would have been in a normal flow
shift where it would normally be
How does setting position absolute on an element affect document flow and where the element appears on the page?
removed from document flow entirely and looks for the first non-static parent it can find to position itself against
What are the box offset properties?
top, bottom, left, and right
What were floats originally designed for?
to allow developers to float text around image elements similar to the way newspapers and magazines would display text. For example:
What are clears for with floats?
allows you to say that no element should touch the left or right hand sides of a box
What are some of the downsides for using floats in layout design?
Element is removed from the document flow.
What is the default flex-direction of a flex container?
row (left-to-right)
What is the default flex-wrap of a flex container?
no wrap = all flex items will be on one line
Why should flex-box not be used for building complete web page layouts?
cant make complex lay-outs
Why is it important to use a grid system for CSS layouts?
easy to adjust things in teams
Why is it important to use a grid system for CSS layouts?
container, column, row.
Why is it a good idea to use percentages for grid column widths?
because if you open your website in a crazy display you want your website to be contained.
How do you think building this layout would be different without a grid system?
T WOULD NOT BE FUN
It would be very tough…
What advantages do you see with using a grid system?
organized (easier to work with),
user friendly (easier for them to use and read)
Why are media queries crucial to responsive grid designs?
automatically adjust the set width of the container class depending on the size of the current browser window
without it, building responsive designs is almost impossible (it is important for the content of the website to adapt to the screen it is displayed on)
What is a variable?
to temporarily store the bits of information it needs to do its job
container that we can store data in and reference by data to be used later on
Why are variables useful?
ability to have something you can reference and use later
What two special characters can a variable begin with?
$ or underscore (_)
How do you declare a variable?
using the VAR keyword
ex. var quantity
Which words cannot be used as variable names?
JavaScript keywords
(if, while, var, const)
–
What is a number in JavaScript?
just a number = 12 , 2 , 3
data type
What is an arithmetic operator?
Name four of the arithmetic operators?
+ , - , / , *,
What is the order of execution?
PEMDAS!!!
What is a string?
data type that consists of letters and other characters in a pair of quotes
What is the string concatenation operator?
joining two or more strings to create a single value using the string operator (+)
What is the difference when it comes to using single quotes or double quotes ( ‘ ‘ or “ “ )?
nothing
How do you escape quotation characters?
backwards slash before any type of quotation mark
example: a href="sale.html\
What is type coercion?
one data type has been converted from one data type to another
ex. concatenation var phrase = 'I am' var age = 29 var phrase2 = ' years old' phrase + age + phrase2