Notes for Codefellows Code 401 301 201 and 102
heading and paragraphs
bold, italic, emphasis <bold><italic><em><strong>
structural and semantic markup h1,p,… vs em,strong,blockquote, q(within paragraph””), abbr,cite,defn,s(strikethrout)
html elements are used to describe the structure of the page (h1,p)
<header>
<nav>
<main>
<content>
<article>
<aside>
<footer>
these are some of the most commonly used ones. These new elements provide clearer code. Note <div>
s are still very important for setting <div.container>
classes (Emmet abbrev here).there are also semantic tags that provide semantic info (em, defn)
white space is being collapsed br linebreak forced and hr line through
comments in html by using ctr
? produces <!--a line of comment in html using Emmet-->
start on a new line
are displayed on the same text/display line
example div, ul, ol, li vs a-tag, span, strong, em, img tags
iframes havent used these yet - interesting for map display - display another website in a window
tell us about the page - seo - live inside the head tags - not visible on page (unless ctrl U in chrome) - commonly used with name and content attributes
example <meta name="description" content="Reading Notes on code102-session04-html" />
name=keywords, name=robots
<, >
special characters used to display reserved characters for code alled escape characters
what CSS does how CSS works rules, properties, values
CSS treats each HTML element as if it appears inside its own box and uses rules 2 indicate how that element should look;
rules R made up of selectors(3 main type of selectors - element, class, ID) and declarations (what these elements should look like);
declarations R made up of 2 parts:
3 ways to set css
block elements (take up all space they can per line, cause a page break - h1,p,div) vs inline (snuggle up - a,b,i,img,em,span)
:nth-child(5)
:1st-child
:last-child
cascading style sheet - rule cascades down to
!important
forces the issue;font-family and color are inherited most others are no but can be made to w propererty value inherit (padding: inherit - from parent element)
scripts R series of statements; like a recipe; scripts are very precise instructions eg a value has to be specified before it can be remembered;
// or /mmmm/ for comments;
variables are used to temporarily store data stored in the script arrays are special types of variables that store more than 1 piece of info JS distinguishes between - numbers(0-9) , strings(text - must b written on 1 line - open and closing quotes must b the same) , Boolean (t/f) assignment operator; take right side and put it in bucket - variable;
var (variable key word) price;
price = 3;
OR write var price = 3;
var quantity = 14;
var total = quantity * price;
var el = document.getElementById('cost');
el.textContent = '$' + total;
like a css tag the docwrite grabs the id=”cost” element;
the el.textContent - writes this into it (and it could even include sth like a <h1>
tag);
naming convention for variables: must begin with letter, $ or _ NOT a number must contain letter, numbers, $ or _ mmmmm NOT - NOT . NOT keywords or reserved words eg var caseSensitive use a name that describes whats stored firstName lastName (camelCase)
array stores a list of variables (>1);
looking at flowchart - browser will run different code in different situations
conditional statements allow your code 2 make decisions about what 2do next;
comparison operators R used 2 compare 2 operands (===, !==, ==, !==, <,>,<=,=>)
;
logical operators (&&, ||, !)
allow us 2 combine > than 1 set of comparisons;
if….else statements allow us 2 run 1 set of code if a condition is true and another if its false;
interesting: