Class 02 Reading Notes
HTML
- Paragraphs must be wrapped in a (p) element
- Headings must be encased in a (h1-6) element
- Structured pages improve the user experience when accessing a page
- Applying JS and CSS is easier when the text is well structured through HTML
Semantics in HTML
- Semantic elements are add meaning to the text they are applied to
HTML Lists
- (ol) Ordered Lists & (ul) unordered lists can be created within HTML
- (li) List items are held within ordered and unordered lists
- Lists are able to be nested into one another
- (dl) Description Lists hold a (dt) description term element with subsequent descriptions wrapped in a (dd) description definition element.
Emphasis vs Strong Importance
- Emphasis can be added be using (em)
- To add importance to text it can be made bold through the use of (strong)
Quotations
- A (blockquote) element is used to indicate a quote from an outside source with a (cite) attribute holding the url for the cited content
- An inline quote uses the (q) element but functions in the same way as a blockquote
Subscript & Superscript (sub)/(sup)
- Used for items such as dates and equations
Code in HTML
- (code) generic code
- (pre) to intsert white space
- (var) for variable names
- (kbd) keyboard input
- (samp) to show output
CSS
Stylesheet
- Used to create styling to HTML
- Linked within the HTML head
Properties and Vaules
- Properties name the feature being changed ex. width
- Values are assigned to the properties named ex. blue
Functions
- Functions allow for simple math (calc) or transformations (trans) ex. rotatation
JavaScript
Conditional Statements
- The (if/else) model provides conditions wherein certain code is ran if the conditions are met (if) or altnertaive code is applied (else) if the conditions are not met
- (else if) allows more options to be applied to the beyond the two (else/if) conditions
Switch Statements
- Takes a single input
- Scans for a matching value
- Executes code for matching value
Ternary Operator (Conditional Operator)
- returns a value if one set of conditions is false and another is true
- uses less code than if else