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 the and tags go in a valid HTML document?
between closing and opening html tag element
What is the purpose of a declaration?
let us know that this is an html document
give 5 examples of html element tags
head tag, body tag, p tag, h1 tag, title tag
What is the purpose of HTML attributes?
provide more information for the html element.
Give an example of an HTML entity (escape character).
® = registered trademark
How do block-level elements affect the document flow?
block starts on new line and takes up the whole width.
How do inline elements affect the document flow?
inline continues and takes as much space as needed.
What are the default width and height of a block-level element?
100% width and the height is based on the html element content.
What are the default width and height of an inline element?
width is based on content as well as height
What is the difference between an ordered list and an unordered list in HTML?
ordered list are numbers and unordered are bullets
Is an HTML list a block element or an inline element?
block
How do you indicate the relative link to a parent directory?
../ to indicate the folder above the currentone, then follow it with the file name.
How do you indicate the relative link to a child directory?
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?
../../ indicate that you want to go up two folders rather than one follow it up with the file name.
How do you indicate the relative link to the same directory?
Just use the file name.
What is the purpose of an HTML form element?
To collect information from visitors using different types of form control.
Give five examples of form control elements.
Text input, radio, button, password input, text area,
Checkboxes, drop down boxes, submit buttons.
Give three examples of type attributes for HTML elements.
button, radio
Is an HTML element a block element or an inline element?
INLINE
name 3 different types of values you can use to specify colors in css.
HEX, NAME AND RGB.
what are the names of the individual pieces of a CSS rule?
CSS RULE SET:
SELECTOR {DECLARATION BLOCK
PROPERTY AND VALUE}
In CSS how do you select elements by their class attribute?
using a period followed by the name
In CSS how do you select elements by their type
just the name of the element
In css how do you select an element by its id attribute?
using “hashtag” # followed by the name.
Name three different types of values you can use to specify colors in CSS.
RGB , HEX AND COLOR VALUE NAME
What CSS properties make up the box model?
It consists of: margins, borders, padding, and the actual content.
Which CSS property pushes boxes away from each other?
MARGIN
Which CSS property add space between a box’s content and its border?
PADDING : BORDER-SPACING
What is a pseudo-class?
A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s). For example, :hover can be used to change a button’s color when the user’s pointer hovers over it.
What are CSS pseudo-classes useful for?
it can be used to: Style an element when a user mouses over it. Style visited and unvisited links differently.
Name at least two units of type size in CSS.
REM, PIXEL
What CSS property controls the font used for the text inside an element?
FONT-FAMILY
What is the default flex-direction of a flex container?
ROW
- What is theevent.target?
- The element that was targeted by the user.
- What is the affect of setting an element todisplay: none?
- it prevents the html from rendering.
- What does theelement.matches()method take as an argument and what does it return?
- argument: css selector string and it returns a boolean if it is a match or not. true or false.
- How can you retrieve the value of an element’s attribute?
- getAttribute()
- At what steps of the solution would it be helpful to log things to the console?
- -every step you’re unsure of not getting results ; everywhere you log it.
- If you were to add another tab and view to your HTML, but you didn’t use event delegation, how would your JavaScript code be written instead?
- you would have to manually set an event listener for each tab. -
- If you didn’t use a loop to conditionally show or hide the views in the
- If you didn’t use a loop to conditionally show or hide the views in the page, how would your JavaScript code be written instead?
- manually find each element and unset the class.
- What is abreakpointin responsive Web design?
- where the content on the page responds depending on what the media feature width was set at . Place where the media query.
- What is the advantage of using a percentage (e.g.50%)widthinstead of a fixed (e.g.px)widthfor a “column” class in a responsive layout?
percentage will correlate with the device width. whereas 300 pixels is a set amount correlate with the container viewport.
f you introduce CSS rules for a smallermin-widthafterthe styles for a largermin-widthin your style sheet, the CSS rules for thesmallermin-widthwill “win”. Why is that?
- source order : cascade example. CSS the source order is important. Media query should be on the bottom.
- What is JSON?
JSONis a text-based data format following JavaScript object syntax the data is passed in strings.
- object /array rendered to string
- What are serialization and deserialization?
- serialization is turning object/array to string “stings are characters of byte”
- deserialization is turning strings into object/array.
- send and receive data possible.
Simply speakingSerializationis a process of converting an Object into stream of bytes so that it can be transferred over a network or stored in a persistent storage.
Deserialization is the exact opposite - Fetch a stream of bytes from network or persistence storage and convert it back to the Objectwith the same state.
- Why are serialization and deserialization useful?
- might be too large, and we can’t transmit data based on memory data
- serialization is easy to transfer.
- deserialization: is easy to access.
- How do you serialize a data structure into a JSON string using JavaScript?
- using JSON.stringify(); method.
- How do you deserialize a JSON string into a data structure using JavaScript?
- using JSON.parse(); method.
reason for JSON
reason why we have JSON so we have a format where we can transmit data.
takeaway: Strings can be used to store data.
- How to you store data inlocalStorage?
- go to applications then local storage.
- What data type canlocalStoragesave in the browser?
- key and values
- When does the’beforeunload’event fire on thewindowobject?
- -before you unload it will notify you.
- right before you leave the website. Notify with a pop up window.
- before the tab unloads.
- What is amethod?
methods areactions that can be performed on objects. A JavaScript method is a property containing a function definition. Methods are functions stored as object properties.
- How can you tell the difference between a methoddefinitionand a methodcall?
- method call you pass in an argument.
- function inside a method’s name and method call is you’re
- parenthesis .
method definition will always include a code block with the function keyword.
method calls : predefined function. starting with the object.method(‘call’);
- Describe methoddefinitionsyntax (structure).
- property : function assigning to a property
- Describe methodcallsyntax (structure).
object.property().
- How is a method different from any other function?
method are functions stored as object properties
- What is thedefining characteristicof Object-Oriented Programming?
Object-oriented methodology relies on three characteristics that define object-oriented languages:encapsulation, polymorphism, and inheritance.
- What are the four “principles” of Object-Oriented Programming?
- Abstraction
- Encapsulation
- Inheritance
- Polymorphism
- What is “abstraction”?
- Taking something complex and making it simple for example light switch. we just turned on and off, but there’s more complex things behind that light switch.
- What does API stand for?
application programing interface
- What is the purpose of an API?
- someone created a set of tools for you to use. “communication between softwares” interaction between multiple softwares.
- What isthisin JavaScript?
- object The JavaScript this keyword refersto the object it belongs to.
- What does it mean to say thatthisis an “implicit parameter”?
it’s animplicitparameter, meaning that it is available in a function’s code block even though it was never included in the function’s parameter list or declared withvar.
- Whenis the value ofthisdetermined in a function;call timeordefinition time?
call time
- What doesthisrefer to in the following code snippet?
- var character = {
- firstName: ‘Mario’,
- greet: function () {
- var message = ‘It's-a-me, ‘ + this.firstName + ‘!’;
- console.log(message);
- }
- };
- “undefined : this.firstName was not called. the value is determined at call time. “
- Given the abovecharacterobject, what is the result of the following code snippet? Why?character.greet();
It’s a me “mario!”
- Given the abovecharacterobject, what is the result of the following code snippet? Why?var hello = character.greet;
- hello();
It’s a me , undefined! - the greet property was not called with the function.?
How can you tell what the value ofthiswill be for a particular function or methoddefinition?
-there is no way to know what the value yet .
- How can you tell what the value ofthisis for a particular function or methodcall?
- the object left to the left of the dot.
- What kind of inheritance does the JavaScript programming language use?
-prototype-based inheritance
- What is a prototype in JavaScript?
- a prototype in javascript is a template object that allows objects to inherits methods and properties from.
- How is it possible to call methods on strings, arrays, and numbers even though those methods don’t actually exist on objects, arrays, and numbers?
prototype object : inheritance.
- If an object does not have it’s own property or method by a given key, where does JavaScript look for it?
look into the parent object : Prototype object.
a prototype can be under another prototype.
The transition property is shorthand for which four CSS properties?
transition-property, transition-duration, transition-timing-function, and transition-delay.
What event is fired when a user places their cursor in a form control?
focus
What event is fired when a user’s cursor leaves a form control?
blur