p {
margin:32px;
padding:12px;
}
.apple {
color:red;
}
5" phone to 72" TV
// Javascript
if (condition) {
// Some JS that will run if the condition is met.
}
/* CSS */
@media (condition) {
/* Some CSS that'll run if the condition is met. */
}
How to decide which to use? (max-width or min-width)
if your default layout is for large screen & you want to add something for small screen then max-width, vice-versa.
/* 🚫 Not valid, since `font-size` can't be queried */
@media (font-size: 32px) {
}
<style>
p::before {
content: '→ ';
color: deeppink;
}
p::after {
content: ' ←';
color: deeppink;
}
</style>
<p>
This paragraph has little arrows!
</p>
<style>
.pseudo-pseudo {
color: deeppink;
}
</style>
<p>
<span class="pseudo-pseudo">→ </span>
This paragraph has little arrows!
<span class="pseudo-pseudo"> ←</span>
</p>
2.1 psuedo elements: before & after
=
Children -> element that is only 1 level down from parent
Descendant -> element that maybe 1 level, 2 level down..
keywords: red
easy to remember, no maths
useful in tutorials
no way to get shades
hex : #ff0000
terse(short to write)
inscrutable - don't know what color it will show up
rgb: rgb(255,0,0)
no way to pick shade
hsl: hsl(0deg, 100%, 50%)
hue - pigment, saturation - how much color, lightness
when you are inside ide, really easy to derive number for shadow / other cases
humans don't see colors linearly, our perception changes on frequency