MAD 9014 - serdarulutas/MADD-Notes GitHub Wiki
WEEK-3
* margin : t r b l
* margin : all
* margin : tb lr
* margin : t r/l b
* padding : t r b l
* padding : all
* padding : tb lr
* padding : t r/l b
- margin has no background color
- padding has the same background color as the tag
- border has its own color
CSS Descendant
main a
-> all a
anchors within main
main span
-> same as above
main > a
-> a
anchors that are direct children of main
p > a
-> same as above.
p + a
-> style a
only if it follows a p
tag immediately.
p ~ a
-> this applies to all a
tags that are sibling to a p
tag. (doesn't matter if it is immediate or not)
Specificity
- id
- classes, attribute selectors
- type selectors (::pseudo-elements)
WEEK 1-2
FALSEY Values
If a value is not one of the values below, then it is a truthy
false
0
""
null
undefined
NaN
IF Statements
if (condition){
//
}else if (condition){
//
}else if (condition){
//
}else{
//
}
Logical Short-circuiting
each variable/expression returns a truthy or falsey value.
if (var){
}
Ternary Statement
condition ? true : false
e.g.
isAdult = age > 18 ? true : false;
Switch Statement
switch (expression){
case option1:
//do something
break;
case option2, option3, option4:
//do something
break;
default:
//do something
break;
}
Strings
concat
function can have multiple parameters, such as "greeting".concat(" ", "Jimmy", " ", "How are you?");