Skip to article frontmatterSkip to article content
tools = require('../js/tools'); tools.init()
Loading...

too many to be listed

text properties

Loading...

many fonts available

the example below illustrates how to load and use them in your page

Loading...

notes on the fonts example (1)

notes on the fonts example (2)

notes on the fonts example (3)

<link rel="stylesheet"
      href="https://fonts.googleapis.com/css?family=Raleway:200,200i,400,400i,500,500i,600,600i,700,700i">

Unicode characters

Loading...

Unicode - the easy way

if you need to insert e.g. the ℃ symbol, you can do it several ways :

easiest way : just cut-and-paste it right into the html as-is (provided that your html file is utf8-encoded)

Unicode - shortnames

some characters can be inserted with the &...; notation using nicknames, like e.g.

Unicode - the less easy way (advanced)

each Unicode character has a unique codepoint
you can use that in a pure-ASCII source, and write either

the box model

so much about fonts and text, now for something completely different:

each visible element can be styled according to the box model, as shown in the browser devel tools

atomic properties (1)

each side (top, right, bottom, left) of the box has its own individual properties
here e.g. we illustrate this with padding and border

click on Open in new window and use inspector on the <p> element

Loading...

atomic properties (2)

again with also margin and border-radius - nothing really new, but you can see the combinations are likely to be numerous ...

Loading...

shorthand properties

of course this can become quite tedious, so there also are so-called shorthand properties
that allow to set several atomic properties in one line
for dealing with paddings, margins, borders and fonts, among others

one trick is to remember this figure

more shorthands

same kind of shorthands are available for

shorthand example

use the inspector from the devel tools to check the individual properties of the <p> elt, e.g. the padding

Loading...

unit lengths

a great many deal of units are available to express lengths - see more details on this page , e.g. :

colors

several formats are supported to describe a color :

you can read more on this on css-tricks

colors: online resources

background

there are 8 elementary properties that make an element’s background

background shorthand

most often this is set through a unique shorthand property background

https://css-tricks.com/almanac/properties/b/background/

also note that background

background and margins (demo)

Loading...

background - demo explained

box-sizing

the box-sizing property affects the way width and height properties are computed:

(note that margins are always excluded)

not often needed, but typical use case is

see also https://css-tricks.com/box-sizing/ that has a live demo, as well as https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing#browser_compatibility