Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

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...

Unicode characters

Loading...

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

note that the margin area is technically not part of the element !
it is just a space around it, that remains transparent (so colored by parent)


atomic properties

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...

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 a single line

this is available for dealing with paddings, margins, borders, fonts, among others…


one trick is to remember this figure


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


more shorthands

same kind of shorthands are available for


background

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

background-colorbackground-image
background-repeatbackground-position
background-sizebackground-attachment
background-originbackground-clip

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 only covers the padding area


box-sizing (optional)

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