CSS

MOC Web Development

Created: 2022-08-09
Tags: #fleeting


Where do default style of browsers come from?
https://youtu.be/spK_S0HfzFw

CSS is a rule-based language, you define the rules by
specifying groups of styles that should be applied to particular elements
or groups of elements on your web page.

CSS must use US spelling, so colour must be only use as color

Everything in CSS generates a box

Syntax and Lingo of CSS

CSS specs are intended for engineers to use
to implement support for the features in user agents,
NOT for web developers to read to understand CSS.

Many experienced developers would much rather refer to MDN documentation or other tutorials. Nevertheless, it is worth knowing that these specs exist and understanding the relationship between the CSS you are using, the browser support (see below), and the specs.

Find the "browser compatability" of a css property

Browsers usually doesn't integrate a feature at the same time
You can use some CSS in some browsers and not in others.

Lastly, you can combine multiple types together

body h1 + p .special {
  color: yellow;
  background-color: black;
  padding: 5px;
}

This will style any element with a class of special,
which is inside a <p>,
which comes just after an <h1>,
which is inside a <body>. Phew!