diff --git a/README.md b/README.md index 54a598a6..2c862e98 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ -# [CSS Reference](http://cssreference.io): a free visual guide to the most popular CSS properties +# [CSS Reference](https://cssreference.io): a free visual guide to the most popular CSS properties -[![CSS Reference screenshot](https://raw.github.com/jgthms/css-reference/master/images/css-reference-share.png)](http://cssreference.io) +[![CSS Reference screenshot](https://raw.github.com/jgthms/css-reference/master/images/css-reference-share.png)](https://cssreference.io) # License -The content of this project itself is licensed under the [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/). +The content of this project itself is licensed under the [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-nc-sa/4.0/). -The underlying source code used to format and display that content is licensed under the [MIT license](http://opensource.org/licenses/mit-license.php). +The underlying source code used to format and display that content is licensed under the [MIT license](https://opensource.org/licenses/mit-license.php). -# Sponsor - - Sponsor +

Browser testing via

diff --git a/_config.yml b/_config.yml index 6a236cd3..34118546 100644 --- a/_config.yml +++ b/_config.yml @@ -2,7 +2,7 @@ title: CSS Reference subtitle: "A free visual guide to CSS" description: "CSS Reference is a free visual guide to CSS. It features the most popular properties, and explains them with illustrated and animated examples." share: "CSS Reference: a free visual guide to the most popular CSS properties." -url: http://cssreference.io +url: https://cssreference.io markdown: kramdown permalink: pretty exclude: ['node_modules'] diff --git a/_includes/bsa.html b/_includes/bsa.html new file mode 100644 index 00000000..a46af284 --- /dev/null +++ b/_includes/bsa.html @@ -0,0 +1,11 @@ + +
+ diff --git a/_includes/collections/css-grid-list.html b/_includes/collections/css-grid-list.html new file mode 100644 index 00000000..c411ab2b --- /dev/null +++ b/_includes/collections/css-grid-list.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/_includes/collections/css-grid.html b/_includes/collections/css-grid.html new file mode 100644 index 00000000..485f0499 --- /dev/null +++ b/_includes/collections/css-grid.html @@ -0,0 +1 @@ +

#grid-area

default grid-area: auto;

The grid item's column and row starts and ends are automatically set.

grid-area: main;

You can use an area name.

#grid-auto-columns

Defines the size of grid columns that were created implicitly: it means that grid-auto-columns targets the columns that were not defined with grid-template-columns or grid-template-areas.

default grid-auto-columns: auto;

The implicity-created columns have an auto size.

grid-auto-columns: 100px;

Here we combine grid-template-areas: "header header header" "sidebar main main" with grid-template-columns: 50px 200px.

In this situation, the grid-template-areas defines 3 columns, while the grid-template-columns only defines 2 column widths.

As a result, the third column width takes its value from the grid-auto-columns property: 100px.

#grid-auto-flow

Defines the position of auto-generated grid items.

default grid-auto-flow: row;

Here we have grid-template-areas: "header header header" "sidebar main main" "footer footer footer", plus an additional "Other" grid item. The algorithm places it on its own row.

grid-auto-flow: column;

Here we have grid-template-areas: "header header header" "sidebar main main" "footer footer footer", plus an additional "Other" grid item. The algorithm places it in its own column.

#grid-auto-rows

Defines the size of grid rows that were created implicitly: it means that grid-auto-rows targets the rows that were not defined with grid-template-rows or grid-template-areas.

default grid-auto-rows: auto;

The implicity-created rows have an auto size.

grid-auto-rows: 100px;

Here we combine grid-template-areas: "header header header" "sidebar main main" "footer footer footer" with grid-template-rows: 50px 200px.

In this situation, the grid-template-areas defines 3 rows, while the grid-template-rows only defines 2 row heights.

As a result, the third row height (the footer) takes its value from the grid-auto-rows property: 100px.

#grid-column-end

Defines the column end position of a grid item.

default grid-column-end: auto;

In this 3-column setup, the grid item is automatically placed.

grid-column-end: 2;

The target grid item ends just before the second column.

grid-column-end: 1;

The target grid item ends just before the first column, which automatically creates a fourth column.

#grid-column-gap

Defines the gutter between the columns of a grid container.

default grid-column-gap: 0;

Removes the gap.

grid-column-gap: 10px;

You can use pixel values.

grid-column-gap: 3rem;

You can use (r)em values.

grid-column-gap: 20%;

You can use percentage values.

#grid-column-start

Defines the column start position of a grid item.

default grid-column-start: auto;

In this 3-column setup, the grid item is automatically placed.

grid-column-start: 2;

The target grid item is placed on the second column.

grid-column-start: 4;

The target grid item is placed outside the grid, in an auto-generated fourth column.

#grid-column

Shorthand property for grid-column-start and grid-column-end.

default grid-column: auto auto;

The grid item's column start and end are automatically set.

grid-column: 1 / 3;

The grid item starts before the first column and ends just before the third one.

grid-column: span 3;

The grid item spans 3 columns.

grid-column: 1 / span 4;

The grid items starts before the first column and spans for 4 columns, creating a new one in the process.

grid-column: main;

You can use an area name to "copy" its column start and end positions.

#grid-gap

Shorthand property for grid-row-gap and grid-column-gap.

default grid-gap: 0 0;

Removes both rows and columns gaps.

grid-gap: 10px;

You can set a single value.

grid-gap: 3rem 1rem;

You can set a value for each direction: rows first, columns second.

#grid-row-end

Defines the row end position of a grid item.

default grid-row-end: auto;

In this 3-column setup, the grid item is automatically placed.

grid-row-end: 3;

The target grid item ends just before the third row.

grid-row-end: 4;

The target grid item ends just before the fourth row, which automatically creates a third row.

#grid-row-gap

Defines the gutter between the rows of a grid container.

default grid-row-gap: 0;

Removes the gap.

grid-row-gap: 10px;

You can use pixel values.

grid-row-gap: 3rem;

You can use (r)em values.

#grid-row-start

Defines the row start position of a grid item.

default grid-row-start: auto;

In this 3-column setup, the grid item is automatically placed on the first row.

grid-row-start: 2;

The target grid item is placed on the second row.

grid-row-start: 3;

The target grid item is placed outside the grid, in an auto-generated third row.

#grid-row

Shorthand property for grid-row-start and grid-row-end.

default grid-row: auto auto;

The grid item's row start and end are automatically set.

grid-row: 1 / 3;

The grid item starts before the first row and ends just before the third one.

grid-row: span 3;

The grid item spans 3 rows.

grid-row: 1 / span 4;

The grid items starts before the first row and spans for 4 rows, creating a new one in the process.

grid-row: header;

You can use an area name to "copy" its row start and end positions.

#grid-template-areas

Defines areas within a grid container. These areas can then be referenced when placing a grid item.

default grid-template-areas: none;

No area is defined.

grid-template-areas: "header header header" "sidebar main main";

You can use area names to specify which cells each grid item should occupy.

#grid-template-columns

Defines the columns of a grid container. You can specify the width of a column by using a keyword (like auto) or a length (like 10px). The number of columns is determined by the number of values defined in the space-separated list.

default grid-template-columns: none;

No columns are defined, so you only have one.

grid-template-columns: auto auto auto;

You can use the keyword auto so that each column resizes itself automatically.

grid-template-columns: 80px auto 1rem;

You can mix the units.

grid-template-columns: 40px 1fr 2fr;

You can use the fr flex unit to distribute the remaining space across all flex columns.

#grid-template-rows

Defines the rows of a grid container. You can specify the width of a row by using a keyword (like auto) or a length (like 10px). The number of rows is determined by the number of values defined in the space-separated list.

default grid-template-rows: none;

No rows are defined.

grid-template-rows: 120px auto 3rem;

You can mix the units.

grid-template-rows: 20px 1fr 2fr;

You can use the fr flex unit to distribute the remaining space across all flex rows.

#grid-template

default grid-template: none;

No rows, columns, or areas are defined.

grid-template: 200px 1fr / 100px auto 3rem;

You can define rows first, columns second, by splitting them with a slash /.

grid-template: "header header header" 50px "sidebar main main" 200px / 100px auto;

You can define both areas and rows and columns dimensions. In this case, each set of areas have a row size attached to it. The first row is 50px high, the second one is 200px high. The sidebar column is 100px wide, while the main column's width is set to auto and takes up the remaining width.

#grid

grid: "header header header" 50px "sidebar main main" 200px / 100px auto;

You can use it as grid-template by setting all explicit rows, columns, and areas.

grid: 200px 100px / auto-flow 30%;

You can combine grid-template-rows with grid-auto-columns.

grid: auto-flow 50px / 200px 100px;

You can combine grid-auto-rows with grid-template-columns.

\ No newline at end of file diff --git a/_includes/collections/flexbox.html b/_includes/collections/flexbox.html index ab41624d..96cbb7c9 100644 --- a/_includes/collections/flexbox.html +++ b/_includes/collections/flexbox.html @@ -1 +1 @@ -

#align-content

Defines how each line is aligned within a flexbox container. It only applies if flex-wrap: wrap is present, and if there are multiple lines of flexbox items.

default align-content: stretch;

Each line will stretch to fill the remaining space.

In this case, the container is 300px high. All boxes are 50px high, apart from the second one who is 100px high.

  • The first line is 100px high
  • The second line is 50px high
  • The remaing space is 150px

This remaining space is distributed equally amongst the two lines:

  • The first line is now 175px high
  • The second line is now 125px high

align-content: flex-start;

Each line will only fill the space it needs. They will all move towards the start of the flexbox container's cross axis.

align-content: flex-end;

Each line will only fill the space it needs. They will all move towards the end of the flexbox container's cross axis.

align-content: center;

Each line will only fill the space it needs. They will all move towards the center of the flexbox container's cross axis.

align-content: space-between;

Each line will only fill the space it needs. The remaining space will appear between the lines.

align-content: space-around;

Each line will only fill the space it needs. The remaining space will be distributed equally around the lines: before the first line, between the two, and after the last one.

#align-items

Defines how flexbox items are aligned according to the cross axis, within a line of a flexbox container.

align-items: flex-start;

The flexbox items are aligned at the start of the cross axis.

By default, the cross axis is vertical. This means the flexbox items will be aligned vertically at the top.

align-items: flex-end;

The flexbox items are aligned at the end of the cross axis.

By default, the cross axis is vertical. This means the flexbox items will be aligned vertically at the bottom.

align-items: center;

The flexbox items are aligned at the center of the cross axis.

By default, the cross axis is vertical. This means the flexbox items will be centered vertically.

align-items: baseline;

The flexbox items are aligned at the baseline of the cross axis.

By default, the cross axis is vertical. This means the flexbox items will align themselves in order to have the baseline of their text align along a horizontal line.

align-items: stretch;

The flexbox items will stretch across the whole cross axis.

By default, the cross axis is vertical. This means the flexbox items will fill up the whole vertical space.

#align-self

Works like align-items, but applies only to a single flexbox item, instead of all of them.

default align-self: auto;

The target will use the value of align-items.

align-self: flex-start;

If the container has align-items: center and the target has align-self: flex-start, only the target will be at the start of the cross axis.

By default, this means it will be aligned vertically at the top.

align-self: flex-end;

If the container has align-items: center and the target has align-self: flex-end, only the target will be at the end of the cross axis.

By default, this means it will be aligned vertically at the bottom.

align-self: center;

If the container has align-items: flex-start and the target has align-self: center, only the target will be at the center of the cross axis.

By default, this means it will be vertically centered.

align-self: baseline;

If the container has align-items: center and the target has align-self: baseline, only the target will be at the baseline of the cross axis.

By default, this means it will be aligned along the basline of the text.

align-self: stretch;

If the container has align-items: center and the target has align-self: stretch, only the target will stretch along the whole cross axis.

#flex-basis

Defines the initial size of a flexbox item.

default flex-basis: auto;

The element will be automatically sized based on its content, or on any height or width value if they are defined.

flex-basis: 80px;

You can define pixel or (r)em values. The element will wrap its content to avoid any overflow.

#flex-direction

Defines how flexbox items are ordered within a flexbox container.

default flex-direction: row;

The flexbox items are ordered the same way as the text direction, along the main axis.

flex-direction: row-reverse;

The flexbox items are ordered the opposite way as the text direction, along the main axis.

flex-direction: column;

The flexbox items are ordered the same way as the text direction, along the cross axis.

flex-direction: column-reverse;

The flexbox items are ordered the opposite way as the text direction, along the cross axis.

#flex-flow

Shorthand property for flex-direction and flex-wrap.

#flex-grow

Defines how much a flexbox item should grow if there's space available.

default flex-grow: 0;

The element will not grow if there's space available. It will only use the space it needs.

flex-grow: 1;

The element will grow by a factor of 1. It will fill up the remaining space if no other flexbox item has a flex-grow value.

flex-grow: 2;

Because the flex-grow value is relative, its behaviour depends on the value of the flexbox item siblings.

In this example, the remaining space is divided in 3:

  • 1 third goes to the green item
  • 2 thirds go to the pink item
  • Nothing goes to the yellow item, who retains its initial width

#flex-shrink

Defines how much a flexbox item should shrink if there's not enough space available.

default flex-shrink: 1;

If there's not enough space available in the container's main axis, the element will shrink by a factor of 1, and will wrap its content.

flex-shrink: 0;

The element will not shrink: it will retain the width it needs, and not wrap its content. Its siblings will shrink to give space to the target element.

Because the target element will not wrap its content, there is a chance for the flexbox container's content to overflow.

flex-shrink: 2;

Because the flex-shrink value is relative, its behaviour depends on the value of the flexbox item siblings.

In this example, the green item wants to fill 100% of the width. The space it needs is taken from its two siblings, and is divided in 4:

  • 3 quarters are taken from the red item
  • 1 quarter is taken from the yellow item

#flex-wrap

Defines if flexbox items appear on a single line or on multiple lines within a flexbox container.

default flex-wrap: nowrap;

The flexbox items will remain on a single line, no matter what, and will eventually overflow if needed.

flex-wrap: wrap;

The flexbox items will be distributed among multiple lines if needed.

flex-wrap: wrap-reverse;

The flexbox items will be distributed among multiple lines if needed. Any additional line will appear before the previous one.

#justify-content

Defines how flexbox items are aligned according to the main axis, within a flexbox container.

default justify-content: flex-start;

The flexbox items are pushed towards the start of the container's main axis.

justify-content: flex-end;

The flexbox items are pushed towards the end of the container's main axis.

justify-content: center;

The flexbox items are centered along the container's main axis.

justify-content: space-between;

The remaining space is distributed between the flexbox items.

justify-content: space-around;

The remaining space is distributed around the flexbox items: this adds space before the first item and after the last one.

#order

Defines the order of a flexbox item.

default order: 0;

The order of the flexbox items is the one defined in the HTML code.

order: 1;

The order is relative to the flexbox item's siblings. The final order is defined when all individual flexbox item order values are taken into account.

order: -1;

You can use negative values.

order: 9;

You can set a different value for each flexbox item.

\ No newline at end of file +

#align-content

Defines how each line is aligned within a flexbox/grid container. It only applies if flex-wrap: wrap is present, and if there are multiple lines of flexbox/grid items.

default align-content: stretch;

Each line will stretch to fill the remaining space.

In this case, the container is 300px high. All boxes are 50px high, apart from the second one who is 100px high.

  • The first line is 100px high
  • The second line is 50px high
  • The remaing space is 150px

This remaining space is distributed equally amongst the two lines:

  • The first line is now 175px high
  • The second line is now 125px high

align-content: flex-start;

Each line will only fill the space it needs. They will all move towards the start of the flexbox/grid container's cross axis.

align-content: flex-end;

Each line will only fill the space it needs. They will all move towards the end of the flexbox/grid container's cross axis.

align-content: center;

Each line will only fill the space it needs. They will all move towards the center of the flexbox/grid container's cross axis.

align-content: space-between;

Each line will only fill the space it needs. The remaining space will appear between the lines.

align-content: space-around;

Each line will only fill the space it needs. The remaining space will be distributed equally around the lines: before the first line, between the two, and after the last one.

#align-items

Defines how flexbox items are aligned according to the cross axis, within a line of a flexbox container.

align-items: flex-start;

The flexbox items are aligned at the start of the cross axis.

By default, the cross axis is vertical. This means the flexbox items will be aligned vertically at the top.

align-items: flex-end;

The flexbox items are aligned at the end of the cross axis.

By default, the cross axis is vertical. This means the flexbox items will be aligned vertically at the bottom.

align-items: center;

The flexbox items are aligned at the center of the cross axis.

By default, the cross axis is vertical. This means the flexbox items will be centered vertically.

align-items: baseline;

The flexbox items are aligned at the baseline of the cross axis.

By default, the cross axis is vertical. This means the flexbox items will align themselves in order to have the baseline of their text align along a horizontal line.

align-items: stretch;

The flexbox items will stretch across the whole cross axis.

By default, the cross axis is vertical. This means the flexbox items will fill up the whole vertical space.

#align-self

Works like align-items, but applies only to a single flexbox item, instead of all of them.

default align-self: auto;

The target will use the value of align-items.

align-self: flex-start;

If the container has align-items: center and the target has align-self: flex-start, only the target will be at the start of the cross axis.

By default, this means it will be aligned vertically at the top.

align-self: flex-end;

If the container has align-items: center and the target has align-self: flex-end, only the target will be at the end of the cross axis.

By default, this means it will be aligned vertically at the bottom.

align-self: center;

If the container has align-items: flex-start and the target has align-self: center, only the target will be at the center of the cross axis.

By default, this means it will be vertically centered.

align-self: baseline;

If the container has align-items: center and the target has align-self: baseline, only the target will be at the baseline of the cross axis.

By default, this means it will be aligned along the basline of the text.

align-self: stretch;

If the container has align-items: center and the target has align-self: stretch, only the target will stretch along the whole cross axis.

#flex-basis

Defines the initial size of a flexbox item.

default flex-basis: auto;

The element will be automatically sized based on its content, or on any height or width value if they are defined.

flex-basis: 80px;

You can define pixel or (r)em values. The element will wrap its content to avoid any overflow.

#flex-direction

Defines how flexbox items are ordered within a flexbox container.

default flex-direction: row;

The flexbox items are ordered the same way as the text direction, along the main axis.

flex-direction: row-reverse;

The flexbox items are ordered the opposite way as the text direction, along the main axis.

flex-direction: column;

The flexbox items are ordered the same way as the text direction, along the cross axis.

flex-direction: column-reverse;

The flexbox items are ordered the opposite way as the text direction, along the cross axis.

#flex-flow

Shorthand property for flex-direction and flex-wrap.

#flex-grow

Defines how much a flexbox item should grow if there's space available.

default flex-grow: 0;

The element will not grow if there's space available. It will only use the space it needs.

flex-grow: 1;

The element will grow by a factor of 1. It will fill up the remaining space if no other flexbox item has a flex-grow value.

flex-grow: 2;

Because the flex-grow value is relative, its behaviour depends on the value of the flexbox item siblings.

In this example, the remaining space is divided in 3:

  • 1 third goes to the green item
  • 2 thirds go to the pink item
  • Nothing goes to the yellow item, who retains its initial width

#flex-shrink

Defines how much a flexbox item should shrink if there's not enough space available.

default flex-shrink: 1;

If there's not enough space available in the container's main axis, the element will shrink by a factor of 1, and will wrap its content.

flex-shrink: 0;

The element will not shrink: it will retain the width it needs, and not wrap its content. Its siblings will shrink to give space to the target element.

Because the target element will not wrap its content, there is a chance for the flexbox container's content to overflow.

flex-shrink: 2;

Because the flex-shrink value is relative, its behaviour depends on the value of the flexbox item siblings.

In this example, the green item wants to fill 100% of the width. The space it needs is taken from its two siblings, and is divided in 4:

  • 3 quarters are taken from the red item
  • 1 quarter is taken from the yellow item

#flex-wrap

Defines if flexbox items appear on a single line or on multiple lines within a flexbox container.

default flex-wrap: nowrap;

The flexbox items will remain on a single line, no matter what, and will eventually overflow if needed.

flex-wrap: wrap;

The flexbox items will be distributed among multiple lines if needed.

flex-wrap: wrap-reverse;

The flexbox items will be distributed among multiple lines if needed. Any additional line will appear before the previous one.

#justify-content

Defines how flexbox/grid items are aligned according to the main axis, within a flexbox/grid container.

default justify-content: flex-start;

The flexbox/grid items are pushed towards the start of the container's main axis.

justify-content: flex-end;

The flexbox/grid items are pushed towards the end of the container's main axis.

justify-content: center;

The flexbox/grid items are centered along the container's main axis.

justify-content: space-between;

The remaining space is distributed between the flexbox/grid items.

justify-content: space-around;

The remaining space is distributed around the flexbox/grid items: this adds space before the first item and after the last one.

#order

Defines the order of a flexbox item.

default order: 0;

The order of the flexbox items is the one defined in the HTML code.

order: 1;

The order is relative to the flexbox item's siblings. The final order is defined when all individual flexbox item order values are taken into account.

order: -1;

You can use negative values.

order: 9;

You can set a different value for each flexbox item.

\ No newline at end of file diff --git a/_includes/collections/typography.html b/_includes/collections/typography.html index 0cec815b..9fef860b 100644 --- a/_includes/collections/typography.html +++ b/_includes/collections/typography.html @@ -1 +1 @@ -

#color

Defines the color of the text.

color: transparent;

Applies a transparent color to the text. The text will still take up the space it should.

color: red;

You can use one of the 140+ color names.

color: #05ffb0;

You can use hexadecimal color codes.

color: rgb(50, 115, 220);

You can use rgb() color codes:

  • the first value is for red
  • the second value is for green
  • the third value is for blue

Each of them can have a value between 0 and 255.

color: rgba(0, 0, 0, 0.5);

You can use rgba() color codes:

  • the first 3 values are for rgb
  • the 4th value is for the alpha channel and defines the opacity of the color

The alpha value can go from zero 0 (transparent) to one 1 (opaque).

color: hsl(14, 100%, 53%);

You can use hsl() color codes:

  • the first value is for hue and can go from 0 to 359
  • the second value is for saturation and go from 0% to 100%
  • the third value is for luminosity and go from 0% to 100%

color: hsla(14, 100%, 53%, 0.6);

You can use hsl()a color codes:

  • the first 3 values are for hsl
  • the 4th value is for the alpha channel and defines the opacity of the color

The alpha value can go from zero 0 (transparent) to one 1 (opaque).

#font-family

font-family: "Source Sans Pro", "Arial", sans-serif;

When using multiple values, the font-family list of font families defines the priority in which the browser should choose the font family.

The browser will look for each family on the user's computer and in any @font-face resource.

The list is prioritized from left to right: it will use the first value if it's available, or go to the next one, until the end of the list is reached. The default font family is defined by the browser preferences.

In this example, the browser will try to use Source Sans Pro if it's available. If it can't find it, it will try to use Arial. If it's not available either, it will use the browser's sans-serif font.

font-family: serif;

The browser will use a serif font family: all characters have stroke endings.

font-family: sans-serif;

The browser will use a sans-serif font family: no character has stroke endings.

font-family: monospace;

The browser will use a monospace font family: all characters have the same width.

font-family: cursive;

The browser will use a cursive font family.

font-family: fantasy;

The browser will use a fantasy font family.

#font-size

Defines the size of the text.

default font-size: medium;

The text will use the browser's default medium size.

font-size: 20px;

You can use pixel values.

font-size: 1.2em;

You can use em values.

The value is relative to the parent's font-size.
As a result, the value will cascade if used on child elements.

font-size: 1.2rem;

You can use rem values.

The value is relative to the root element's font-size, which is the <html> element.
As a result, the value will not vary depending on the depth of the element in the HTML hierarchy, and will reamin context independent.

font-size: 90%;

You can use percentage values. They act like em values.

The value is relative to the parent's font-size.
As a result, the value will cascade if used on child elements.

font-size: smaller;

You can use relative keywords. The value is relative to the parent.

The following are available:

  • larger
  • smaller

font-size: x-large;

You can use absolute keywords. The value is relative to the root element <html>.

The following are available:

  • xx-small
  • x-small
  • small
  • medium
  • large
  • x-large
  • xx-large

#font-style

Defines how much the text is slanted.

default font-style: normal;

The text is not slanted.

font-style: italic;

Use the italic version of the font: the letters are slightly slanted.

font-style: oblique;

Use the oblique version of the font: the letters are more slanted than italic.

#font-variant

Defines which glyph to use for each letter.

default font-variant: normal;

Each letter uses its normal glyph.

font-variant: small-caps;

Each letter uses its small capitalized version.

#font-weight

Defines the weight of the text.

default font-weight: normal;

The text is in normal weight.

font-weight: bold;

The text becomes bold.

font-weight: 600;

You can use numeric values. They all correspond to a particular named weight:

  • 100 Thin
  • 200 Extra Light
  • 300 Light
  • 400 Normal
  • 500 Medium
  • 600 Semi Bold
  • 700 Bold
  • 800 Extra Bold
  • 900 Ultra Bold

If the font family doesn't provide the requested weight, it will use the closest available one.

font-weight: lighter;

You can use relative keywords: lighter or bolder. The browser will use the next available weight.

#font

#letter-spacing

Defines the spacing between the characters of a block of text.

default letter-spacing: normal;

The spacing between the characters is normal.

letter-spacing: 2px;

You can use pixel values.

letter-spacing: 0.1em;

You can use em values: this allows the spacing to remain relative to the font-size.

#line-height

Defines the height of a single line of text.

default line-height: normal;

Reverts to the default value of the browser.

recommended line-height: 1.6;

You can use unitless values: the line height will be relative to the font size.

line-height: 30px;

You can use pixel values.

line-height: 0.8em;

You can use em values: like with unitless values, the line height will be relative to the font size.

#text-align

Defines how the text content of the element is horizontally aligned.

text-align: left;

The text content is aligned to the left.

text-align: right;

The text content is aligned to the right.

text-align: center;

The text content is centered.

text-align: justify;

The text content is justified.

#text-decoration

Defines how the text content of the element is decorated.

default text-decoration: none;

Removes any text decoration.

text-decoration: underline;

Underlines the text content.

#text-indent

Defines the indentation of the element's first line of text.

default text-indent: 0;

The text is not indented.

text-indent: 40px;

You can use numeric values like pixels, (r)em, percentages...

Notice how only the first line is indented.

text-indent: -2em;

You can also use negative values.

#text-overflow

Defines how the hidden text content behaves if it's overflowing.

default text-overflow: clip;

The text content is clipped and not accessible.

text-overflow: ellipsis;

The overflowing content is replaced by an ellipsis:

#text-shadow

Defines the shadow of the text content.

default text-shadow: none;

The text content has no shadow.

text-shadow: 2px 6px;

You need at least two values:

  • the first is the horizontal offset
  • the second is the vertical offset

The shadow color will be inherited from the text color.

text-shadow: 2px 6px red;

You can define a color as the last value.

As with color, you can use color names, hexadecimal, rgb, hsl...

text-shadow: 2px 4px 10px red;

The optional third value defines the blur of the shadow.

The color will be diffused across 10px in this example, from opaque to transparent.

#text-transform

Defines how the text content should be transformed.

default text-transform: none;

Removes any text transformation: the text will appear the same as in the HTML code.

text-transform: capitalize;

Turns the first letter of each word into a capital letter.

text-transform: uppercase;

Turns all letters into capital letters.

text-transform: lowercase;

Turns all letters into lowercase letters.

#white-space

Defines how the element's white space is handled.

default white-space: normal;

Sequences of spaces are combined into one.
Line breaks are ignored.
The text content is wrapped.

white-space: nowrap;

Sequences of spaces are combined into one.
Line breaks are ignored.
The text content is not wrapped and remains on a single line.

white-space: pre;

The white space is exactly preserved.

  • Sequences of spaces are preserved
  • Lines break only on new lines and <br>

white-space: pre-wrap;

The white space is mostly preserved.

  • Sequences of spaces are preserved
  • Lines break on new lines, <br>, but also when reaching the end of the element

white-space: pre-line;

Only new lines are preserved.

  • Sequences of spaces are combined into one
  • Lines break on new lines, <br>, but also when reaching the end of the element

#word-break

Defines how words should break when reaching the end of a line.

default word-break: normal;

Words with no space will not break. Sequences of uninterrupted characters will be displayed on a single line.

word-break: break-all;

Words with no space will break as soon as they reach the end of a line.

#word-spacing

Defines the spacing between words of a block of text.

default word-spacing: normal;

The spacing between the characters is normal.

word-spacing: 5px;

You can use pixel values.

word-spacing: 2em;

You can use em values: this allows the spacing to remain relative to the font-size.

\ No newline at end of file +

#color

Defines the color of the text.

color: transparent;

Applies a transparent color to the text. The text will still take up the space it should.

color: red;

You can use one of the 140+ color names.

color: #05ffb0;

You can use hexadecimal color codes.

color: rgb(50, 115, 220);

You can use rgb() color codes:

  • the first value is for red
  • the second value is for green
  • the third value is for blue

Each of them can have a value between 0 and 255.

color: rgba(0, 0, 0, 0.5);

You can use rgba() color codes:

  • the first 3 values are for rgb
  • the 4th value is for the alpha channel and defines the opacity of the color

The alpha value can go from zero 0 (transparent) to one 1 (opaque).

color: hsl(14, 100%, 53%);

You can use hsl() color codes:

  • the first value is for hue and can go from 0 to 359
  • the second value is for saturation and go from 0% to 100%
  • the third value is for luminosity and go from 0% to 100%

color: hsla(14, 100%, 53%, 0.6);

You can use hsl()a color codes:

  • the first 3 values are for hsl
  • the 4th value is for the alpha channel and defines the opacity of the color

The alpha value can go from zero 0 (transparent) to one 1 (opaque).

#font-family

font-family: "Source Sans Pro", "Arial", sans-serif;

When using multiple values, the font-family list of font families defines the priority in which the browser should choose the font family.

The browser will look for each family on the user's computer and in any @font-face resource.

The list is prioritized from left to right: it will use the first value if it's available, or go to the next one, until the end of the list is reached. The default font family is defined by the browser preferences.

In this example, the browser will try to use Source Sans Pro if it's available. If it can't find it, it will try to use Arial. If it's not available either, it will use the browser's sans-serif font.

font-family: serif;

The browser will use a serif font family: all characters have stroke endings.

font-family: sans-serif;

The browser will use a sans-serif font family: no character has stroke endings.

font-family: monospace;

The browser will use a monospace font family: all characters have the same width.

font-family: cursive;

The browser will use a cursive font family.

font-family: fantasy;

The browser will use a fantasy font family.

#font-size

Defines the size of the text.

default font-size: medium;

The text will use the browser's default medium size.

font-size: 20px;

You can use pixel values.

font-size: 1.2em;

You can use em values.

The value is relative to the parent's font-size.
As a result, the value will cascade if used on child elements.

font-size: 1.2rem;

You can use rem values.

The value is relative to the root element's font-size, which is the <html> element.
As a result, the value will not vary depending on the depth of the element in the HTML hierarchy, and will reamin context independent.

font-size: 90%;

You can use percentage values. They act like em values.

The value is relative to the parent's font-size.
As a result, the value will cascade if used on child elements.

font-size: smaller;

You can use relative keywords. The value is relative to the parent.

The following are available:

  • larger
  • smaller

font-size: x-large;

You can use absolute keywords. The value is relative to the root element <html>.

The following are available:

  • xx-small
  • x-small
  • small
  • medium
  • large
  • x-large
  • xx-large

#font-style

Defines how much the text is slanted.

default font-style: normal;

The text is not slanted.

font-style: italic;

Use the italic version of the font: the letters are slightly slanted.

font-style: oblique;

Use the oblique version of the font: the letters are more slanted than italic.

#font-variant

Defines which glyph to use for each letter.

default font-variant: normal;

Each letter uses its normal glyph.

font-variant: small-caps;

Each letter uses its small capitalized version.

#font-weight

Defines the weight of the text.

default font-weight: normal;

The text is in normal weight.

font-weight: bold;

The text becomes bold.

font-weight: 600;

You can use numeric values. They all correspond to a particular named weight:

  • 100 Thin
  • 200 Extra Light
  • 300 Light
  • 400 Normal
  • 500 Medium
  • 600 Semi Bold
  • 700 Bold
  • 800 Extra Bold
  • 900 Ultra Bold

If the font family doesn't provide the requested weight, it will use the closest available one.

font-weight: lighter;

You can use relative keywords: lighter or bolder. The browser will use the next available weight.

#font

#letter-spacing

Defines the spacing between the characters of a block of text.

default letter-spacing: normal;

The spacing between the characters is normal.

letter-spacing: 2px;

You can use pixel values.

letter-spacing: 0.1em;

You can use em values: this allows the spacing to remain relative to the font-size.

#line-height

Defines the height of a single line of text.

default line-height: normal;

Reverts to the default value of the browser.

recommended line-height: 1.6;

You can use unitless values: the line height will be relative to the font size.

line-height: 30px;

You can use pixel values.

line-height: 0.8em;

You can use em values: like with unitless values, the line height will be relative to the font size.

#text-align

Defines how the text content of the element is horizontally aligned.

text-align: left;

The text content is aligned to the left.

text-align: right;

The text content is aligned to the right.

text-align: center;

The text content is centered.

text-align: justify;

The text content is justified.

#text-decoration

Defines how the text content of the element is decorated.

default text-decoration: none;

Removes any text decoration.

text-decoration: underline;

Underlines the text content.

#text-indent

Defines the indentation of the element's first line of text.

default text-indent: 0;

The text is not indented.

text-indent: 40px;

You can use numeric values like pixels, (r)em, percentages...

Notice how only the first line is indented.

text-indent: -2em;

You can also use negative values.

#text-overflow

Defines how the hidden text content behaves if it's overflowing.

default text-overflow: clip;

The text content is clipped and not accessible.

text-overflow: ellipsis;

The overflowing content is replaced by an ellipsis:

#text-shadow

Defines the shadow of the text content.

default text-shadow: none;

The text content has no shadow.

text-shadow: 2px 6px;

You need at least two values:

  • the first is the horizontal offset
  • the second is the vertical offset

The shadow color will be inherited from the text color.

text-shadow: 2px 6px red;

You can define a color as the last value.

As with color, you can use color names, hexadecimal, rgb, hsl...

text-shadow: 2px 4px 10px red;

The optional third value defines the blur of the shadow.

The color will be diffused across 10px in this example, from opaque to transparent.

#text-transform

Defines how the text content should be transformed.

default text-transform: none;

Removes any text transformation: the text will appear the same as in the HTML code.

text-transform: capitalize;

Turns the first letter of each word into a capital letter.

text-transform: uppercase;

Turns all letters into capital letters.

text-transform: lowercase;

Turns all letters into lowercase letters.

#white-space

Defines how the element's white space is handled.

default white-space: normal;

Sequences of spaces are combined into one.
Line breaks are ignored.
The text content is wrapped.

white-space: nowrap;

Sequences of spaces are combined into one.
Line breaks are ignored.
The text content is not wrapped and remains on a single line.

white-space: pre;

The white space is exactly preserved.

  • Sequences of spaces are preserved
  • Lines break only on new lines and <br>

white-space: pre-wrap;

The white space is mostly preserved.

  • Sequences of spaces are preserved
  • Lines break on new lines, <br>, but also when reaching the end of the element

white-space: pre-line;

Only new lines are preserved.

  • Sequences of spaces are combined into one
  • Lines break on new lines, <br>, but also when reaching the end of the element

#word-break

Defines how words should break when reaching the end of a line.

default word-break: normal;

Words with no space will not break. Sequences of uninterrupted characters will be displayed on a single line.

word-break: break-all;

Words with no space will break as soon as they reach the end of a line.

#word-spacing

Defines the spacing between words of a block of text.

default word-spacing: normal;

The spacing between the characters is normal.

word-spacing: 5px;

You can use pixel values.

word-spacing: 2em;

You can use em values: this allows the spacing to remain relative to the font-size.

\ No newline at end of file diff --git a/_includes/ff.html b/_includes/ff.html new file mode 100644 index 00000000..bce38953 --- /dev/null +++ b/_includes/ff.html @@ -0,0 +1,9 @@ + +
+

+ New! My 44-page ebook "CSS in 44 minutes" is out! 😃 +

+ + Get it now → + +
diff --git a/_includes/lists/finder-list.html b/_includes/lists/finder-list.html index ac792a0d..d760d9dc 100644 --- a/_includes/lists/finder-list.html +++ b/_includes/lists/finder-list.html @@ -1 +1 @@ -
align-content
flexbox
align-items
flexbox
align-self
flexbox
animation-delay
animations
animation-direction
animations
animation-duration
animations
animation-fill-mode
animations
animation-iteration-count
animations
animation-name
animations
animation-play-state
animations
animation-timing-function
animations
animation
animations
background-attachment
backgrounds
background-clip
backgrounds
background-color
backgrounds
background-image
backgrounds
background-origin
backgrounds
background-position
backgrounds
background-repeat
backgrounds
background-size
backgrounds
background
backgrounds
border-bottom-color
border-bottom-left-radius
border-bottom-right-radius
border-bottom-style
border-bottom-width
box-model
border-bottom
border-collapse
border-color
border-left-color
border-left-style
border-left-width
box-model
border-left
border-radius
border-right-color
border-right-style
border-right-width
box-model
border-right
border-style
border-top-color
border-top-left-radius
border-top-right-radius
border-top-style
border-top-width
box-model
border-top
border-width
box-model
border
bottom
positioning
box-shadow
box-sizing
box-model
clear
color
typography
column-count
column-gap
column-width
content
cursor
display
flex-basis
flexbox
flex-direction
flexbox
flex-flow
flexbox
flex-grow
flexbox
flex-shrink
flexbox
flex-wrap
flexbox
float
font-family
typography
font-size
typography
font-style
typography
font-variant
typography
font-weight
typography
font
typography
height
box-model
justify-content
flexbox
left
positioning
letter-spacing
typography
line-height
box-model typography
list-style-image
list-style-position
list-style-type
list-style
margin-bottom
box-model
margin-left
box-model
margin-right
box-model
margin-top
box-model
margin
box-model
max-height
box-model
max-width
box-model
min-height
box-model
min-width
box-model
mix-blend-mode
opacity
order
flexbox
outline-color
outline-style
outline-width
outline
overflow-wrap
overflow-x
overflow-y
overflow
padding-bottom
box-model
padding-left
box-model
padding-right
box-model
padding-top
box-model
padding
box-model
pointer-events
position
positioning
resize
right
positioning
text-align
typography
text-decoration
typography
text-indent
typography
text-overflow
typography
text-shadow
typography
text-transform
typography
top
positioning
transform-origin
transform
transition-delay
transitions
transition-duration
transitions
transition-property
transitions
transition-timing-function
transitions
transition
transitions
vertical-align
white-space
typography
width
box-model
will-change
word-break
typography
word-spacing
typography
z-index
positioning
\ No newline at end of file +
align-content
flexbox
align-items
flexbox
align-self
flexbox
animation-delay
animations
animation-direction
animations
animation-duration
animations
animation-fill-mode
animations
animation-iteration-count
animations
animation-name
animations
animation-play-state
animations
animation-timing-function
animations
animation
animations
background-attachment
backgrounds
background-clip
backgrounds
background-color
backgrounds
background-image
backgrounds
background-origin
backgrounds
background-position
backgrounds
background-repeat
backgrounds
background-size
backgrounds
background
backgrounds
border-bottom-color
border-bottom-left-radius
border-bottom-right-radius
border-bottom-style
border-bottom-width
box-model
border-bottom
border-collapse
border-color
border-left-color
border-left-style
border-left-width
box-model
border-left
border-radius
border-right-color
border-right-style
border-right-width
box-model
border-right
border-style
border-top-color
border-top-left-radius
border-top-right-radius
border-top-style
border-top-width
box-model
border-top
border-width
box-model
border
bottom
positioning
box-shadow
box-sizing
box-model
clear
color
typography
column-count
column-gap
column-width
content
cursor
display
flex-basis
flexbox
flex-direction
flexbox
flex-flow
flexbox
flex-grow
flexbox
flex-shrink
flexbox
flex-wrap
flexbox
float
font-family
typography
font-size
typography
font-style
typography
font-variant
typography
font-weight
typography
font
typography
grid-area
css-grid
grid-auto-columns
css-grid
grid-auto-flow
css-grid
grid-auto-rows
css-grid
grid-column-end
css-grid
grid-column-gap
css-grid
grid-column-start
css-grid
grid-column
css-grid
grid-gap
css-grid
grid-row-end
css-grid
grid-row-gap
css-grid
grid-row-start
css-grid
grid-row
css-grid
grid-template-areas
css-grid
grid-template-columns
css-grid
grid-template-rows
css-grid
grid-template
css-grid
grid
css-grid
height
box-model
justify-content
flexbox
left
positioning
letter-spacing
typography
line-height
box-model typography
list-style-image
list-style-position
list-style-type
list-style
margin-bottom
box-model
margin-left
box-model
margin-right
box-model
margin-top
box-model
margin
box-model
max-height
box-model
max-width
box-model
min-height
box-model
min-width
box-model
mix-blend-mode
opacity
order
flexbox
outline-color
outline-style
outline-width
outline
overflow-wrap
overflow-x
overflow-y
overflow
padding-bottom
box-model
padding-left
box-model
padding-right
box-model
padding-top
box-model
padding
box-model
pointer-events
position
positioning
resize
right
positioning
text-align
typography
text-decoration
typography
text-indent
typography
text-overflow
typography
text-shadow
typography
text-transform
typography
top
positioning
transform-origin
transform
transition-delay
transitions
transition-duration
transitions
transition-property
transitions
transition-timing-function
transitions
transition
transitions
vertical-align
white-space
typography
width
box-model
will-change
word-break
typography
word-spacing
typography
z-index
positioning
\ No newline at end of file diff --git a/_includes/lists/menu-list.html b/_includes/lists/menu-list.html index b0e8613e..323a47ca 100644 --- a/_includes/lists/menu-list.html +++ b/_includes/lists/menu-list.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/_includes/menu.html b/_includes/menu.html index e734bfdd..c6ead4d3 100644 --- a/_includes/menu.html +++ b/_includes/menu.html @@ -1,90 +1,179 @@