From 5eb428af47c90dbd49c4ad54d4d1c617cefa8c84 Mon Sep 17 00:00:00 2001
From: Manuel Pinto Defines the color of the text. Applies a transparent color to the text. The text will still take up the space it should. You can use one of the 140+ color names. You can use hexadecimal color codes. You can use rgb() color codes: Each of them can have a value between 0 and 255. You can use rgba() color codes: The alpha value can go from zero 0 (transparent) to one 1 (opaque). You can use hsl() color codes: You can use hsl()a color codes: The alpha value can go from zero 0 (transparent) to one 1 (opaque). When using multiple values, the 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 The browser will use a serif font family: all characters have stroke endings. The browser will use a sans-serif font family: no character has stroke endings. The browser will use a monospace font family: all characters have the same width. The browser will use a cursive font family. The browser will use a fantasy font family. Defines the size of the text. The text will use the browser's default medium size. You can use pixel values. You can use em values. The value is relative to the parent's You can use rem values. The value is relative to the root element's You can use percentage values. They act like em values. The value is relative to the parent's You can use relative keywords. The value is relative to the parent. The following are available: You can use absolute keywords. The value is relative to the root element The following are available: Defines how much the text is slanted. The text is not slanted. Use the italic version of the font: the letters are slightly slanted. Use the oblique version of the font: the letters are more slanted than italic. Defines which glyph to use for each letter. Each letter uses its normal glyph. Each letter uses its small capitalized version. Defines the weight of the text. The text is in normal weight. The text becomes bold. You can use numeric values. They all correspond to a particular named weight: If the font family doesn't provide the requested weight, it will use the closest available one. You can use relative keywords: Shorthand property for Defines the spacing between the characters of a block of text. The spacing between the characters is normal. You can use pixel values. You can use em values: this allows the spacing to remain relative to the font-size. Defines the height of a single line of text. Reverts to the default value of the browser. You can use unitless values: the line height will be relative to the font size. You can use pixel values. You can use em values: like with unitless values, the line height will be relative to the font size. Defines how the text content of the element is horizontally aligned. The text content is aligned to the left. The text content is aligned to the right. The text content is centered. The text content is justified. Defines how the text content of the element is decorated. Removes any text decoration. Underlines the text content. Defines the indentation of the element's first line of text. The text is not indented. You can use numeric values like pixels, (r)em, percentages... Notice how only the first line is indented. You can also use negative values. Defines how the hidden text content behaves if it's overflowing. The text content is clipped and not accessible. The overflowing content is replaced by an ellipsis: Defines the shadow of the text content. The text content has no shadow. You need at least two values: The shadow color will be inherited from the text color. You can define a color as the last value. As with The optional third value defines the blur of the shadow. The color will be diffused across 10px in this example, from opaque to transparent. Defines how the text content should be transformed. Removes any text transformation: the text will appear the same as in the HTML code. Turns the first letter of each word into a capital letter. Turns all letters into capital letters. Turns all letters into lowercase letters. Defines how the element's white space is handled. Sequences of spaces are combined into one. Sequences of spaces are combined into one. The white space is exactly preserved. The white space is mostly preserved. Only new lines are preserved. Defines how words should break when reaching the end of a line. Words with no space will not break. Sequences of uninterrupted characters will be displayed on a single line. Words with no space will break as soon as they reach the end of a line. Defines the spacing between words of a block of text. The spacing between the characters is normal. You can use pixel values. You can use em values: this allows the spacing to remain relative to the font-size. Defines the color of the text. Applies a transparent color to the text. The text will still take up the space it should. You can use one of the 140+ color names. You can use hexadecimal color codes. You can use rgb() color codes: Each of them can have a value between 0 and 255. You can use rgba() color codes: The alpha value can go from zero 0 (transparent) to one 1 (opaque). You can use hsl() color codes: You can use hsla() color codes: The alpha value can go from zero 0 (transparent) to one 1 (opaque). When using multiple values, the 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 The browser will use a serif font family: all characters have stroke endings. The browser will use a sans-serif font family: no character has stroke endings. The browser will use a monospace font family: all characters have the same width. The browser will use a cursive font family. The browser will use a fantasy font family. Defines the size of the text. The text will use the browser's default medium size. You can use pixel values. You can use em values. The value is relative to the parent's You can use rem values. The value is relative to the root element's You can use percentage values. They act like em values. The value is relative to the parent's You can use relative keywords. The value is relative to the parent. The following are available: You can use absolute keywords. The value is relative to the root element The following are available: Defines how much the text is slanted. The text is not slanted. Use the italic version of the font: the letters are slightly slanted. Use the oblique version of the font: the letters are more slanted than italic. Defines which glyph to use for each letter. Each letter uses its normal glyph. Each letter uses its small capitalized version. Defines the weight of the text. The text is in normal weight. The text becomes bold. You can use numeric values. They all correspond to a particular named weight: If the font family doesn't provide the requested weight, it will use the closest available one. You can use relative keywords: Shorthand property for Defines the spacing between the characters of a block of text. The spacing between the characters is normal. You can use pixel values. You can use em values: this allows the spacing to remain relative to the font-size. Defines the height of a single line of text. Reverts to the default value of the browser. You can use unitless values: the line height will be relative to the font size. You can use pixel values. You can use em values: like with unitless values, the line height will be relative to the font size. Defines how the text content of the element is horizontally aligned. The text content is aligned to the left. The text content is aligned to the right. The text content is centered. The text content is justified. Defines how the text content of the element is decorated. Removes any text decoration. Underlines the text content. Defines the indentation of the element's first line of text. The text is not indented. You can use numeric values like pixels, (r)em, percentages... Notice how only the first line is indented. You can also use negative values. Defines how the hidden text content behaves if it's overflowing. The text content is clipped and not accessible. The overflowing content is replaced by an ellipsis: Defines the shadow of the text content. The text content has no shadow. You need at least two values: The shadow color will be inherited from the text color. You can define a color as the last value. As with The optional third value defines the blur of the shadow. The color will be diffused across 10px in this example, from opaque to transparent. Defines how the text content should be transformed. Removes any text transformation: the text will appear the same as in the HTML code. Turns the first letter of each word into a capital letter. Turns all letters into capital letters. Turns all letters into lowercase letters. Defines how the element's white space is handled. Sequences of spaces are combined into one. Sequences of spaces are combined into one. The white space is exactly preserved. The white space is mostly preserved. Only new lines are preserved. Defines how words should break when reaching the end of a line. Words with no space will not break. Sequences of uninterrupted characters will be displayed on a single line. Words with no space will break as soon as they reach the end of a line. Defines the spacing between words of a block of text. The spacing between the characters is normal. You can use pixel values. You can use em values: this allows the spacing to remain relative to the font-size.#color
color: transparent;color: red;color: #05ffb0;color: rgb(50, 115, 220);redgreenbluecolor: rgba(0, 0, 0, 0.5);rgbalpha channel and defines the opacity of the colorcolor: hsl(14, 100%, 53%);hue and can go from 0 to 359saturation and go from 0% to 100%luminosity and go from 0% to 100%color: hsla(14, 100%, 53%, 0.6);hslalpha channel and defines the opacity of the color#font-family
font-family: "Source Sans Pro", "Arial", sans-serif;font-family list of font families defines the priority in which the browser should choose the font family.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;font-family: sans-serif;font-family: monospace;font-family: cursive;font-family: fantasy;#font-size
default font-size: medium;font-size: 20px;font-size: 1.2em;font-size.
As a result, the value will cascade if used on child elements.font-size: 1.2rem;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%;font-size.
As a result, the value will cascade if used on child elements.font-size: smaller;largersmallerfont-size: x-large;<html>.xx-smallx-smallsmallmediumlargex-largexx-large#font-style
default font-style: normal;font-style: italic;font-style: oblique;#font-variant
default font-variant: normal;font-variant: small-caps;#font-weight
default font-weight: normal;font-weight: bold;font-weight: 600;font-weight: lighter;lighter or bolder. The browser will use the next available weight.#font
font-style font-variant font-weight font-size line-height and font-family.#letter-spacing
default letter-spacing: normal;letter-spacing: 2px;letter-spacing: 0.1em;#line-height
default line-height: normal;recommended line-height: 1.6;line-height: 30px;line-height: 0.8em;#text-align
text-align: left;text-align: right;text-align: center;text-align: justify;#text-decoration
default text-decoration: none;text-decoration: underline;#text-indent
default text-indent: 0;text-indent: 40px;text-indent: -2em;#text-overflow
default text-overflow: clip;text-overflow: ellipsis;…#text-shadow
default text-shadow: none;text-shadow: 2px 6px;text-shadow: 2px 6px red;color, you can use color names, hexadecimal, rgb, hsl...text-shadow: 2px 4px 10px red;#text-transform
default text-transform: none;text-transform: capitalize;text-transform: uppercase;text-transform: lowercase;#white-space
default white-space: normal;
Line breaks are ignored.
The text content is wrapped.white-space: nowrap;
Line breaks are ignored.
The text content is not wrapped and remains on a single line.white-space: pre;<br>white-space: pre-wrap;<br>, but also when reaching the end of the elementwhite-space: pre-line;<br>, but also when reaching the end of the element#word-break
default word-break: normal;word-break: break-all;#word-spacing
default word-spacing: normal;word-spacing: 5px;word-spacing: 2em;#color
color: transparent;color: red;color: #05ffb0;color: rgb(50, 115, 220);redgreenbluecolor: rgba(0, 0, 0, 0.5);rgbalpha channel and defines the opacity of the colorcolor: hsl(14, 100%, 53%);hue and can go from 0 to 359saturation and go from 0% to 100%luminosity and go from 0% to 100%color: hsla(14, 100%, 53%, 0.6);hslalpha channel and defines the opacity of the color#font-family
font-family: "Source Sans Pro", "Arial", sans-serif;font-family list of font families defines the priority in which the browser should choose the font family.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;font-family: sans-serif;font-family: monospace;font-family: cursive;font-family: fantasy;#font-size
default font-size: medium;font-size: 20px;font-size: 1.2em;font-size.
As a result, the value will cascade if used on child elements.font-size: 1.2rem;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%;font-size.
As a result, the value will cascade if used on child elements.font-size: smaller;largersmallerfont-size: x-large;<html>.xx-smallx-smallsmallmediumlargex-largexx-large#font-style
default font-style: normal;font-style: italic;font-style: oblique;#font-variant
default font-variant: normal;font-variant: small-caps;#font-weight
default font-weight: normal;font-weight: bold;font-weight: 600;font-weight: lighter;lighter or bolder. The browser will use the next available weight.#font
font-style font-variant font-weight font-size line-height and font-family.#letter-spacing
default letter-spacing: normal;letter-spacing: 2px;letter-spacing: 0.1em;#line-height
default line-height: normal;recommended line-height: 1.6;line-height: 30px;line-height: 0.8em;#text-align
text-align: left;text-align: right;text-align: center;text-align: justify;#text-decoration
default text-decoration: none;text-decoration: underline;#text-indent
default text-indent: 0;text-indent: 40px;text-indent: -2em;#text-overflow
default text-overflow: clip;text-overflow: ellipsis;…#text-shadow
default text-shadow: none;text-shadow: 2px 6px;text-shadow: 2px 6px red;color, you can use color names, hexadecimal, rgb, hsl...text-shadow: 2px 4px 10px red;#text-transform
default text-transform: none;text-transform: capitalize;text-transform: uppercase;text-transform: lowercase;#white-space
default white-space: normal;
Line breaks are ignored.
The text content is wrapped.white-space: nowrap;
Line breaks are ignored.
The text content is not wrapped and remains on a single line.white-space: pre;<br>white-space: pre-wrap;<br>, but also when reaching the end of the elementwhite-space: pre-line;<br>, but also when reaching the end of the element#word-break
default word-break: normal;word-break: break-all;#word-spacing
default word-spacing: normal;word-spacing: 5px;word-spacing: 2em;