- You can have multiline data URIs by escaping each line with a
\
- You can embed SVG in your CSS with data URIs, and you don’t need to %encode most characters
\
▼ 0 0, 50% 100%, 100% 0 ▲ 0 100%, 50% 0, 100% 100%
clip-path
makes clipping to arbitrary shapes a piece of cake!basic shape
, as well as SVG-based clip pathspolygon()
is especially useful, because it can use any CSS length, even calc
and can be animated!0% 0%
is the top left corner and 100% 100%
the bottom right one.filter
property.grayscale()
, saturate()
, hue-rotate()
, blur()
, drop-shadow()
for shadows that actually follow the shape of the element and take transparency into account, and many others.display: flex
enables Flexbox layout on an element.
This element becomes the Flex Container and its children are called Flex Items.flex
: N
defines the proportion that a flex item spreads over.flex-direction
: column
on the flex container makes the items flow from top to bottomalign-items
and justify-content
on the flex container specify alignment in each direction. Which direction depends on the value of flex-direction
display: grid
enables Grid layout on an element.
This element becomes the Grid Container and its children are called Grid Items.display: grid
doesn’t do much on its own, you also have to define the Grid template.
There is a number of properties to do that, such as:
grid-template-rows
grid-template-columns
grid-template
1fr
unit allows us to distribute the available space in fractions without having to do any math with percentages.grid-gap
property allows us to set spacing between the grid cells.grid-row
and grid-column
properties allow us to place items on specific rows and/or columns. Note that multiple items can be placed in the same cell, and then they will overlap!grid-template-areas
allows you to define named areas in your grid.grid-area
allows you to assign an element to a named area.