concept text in category css

appears as: text, The text, text
CSS in Depth

This is an excerpt from Manning's book CSS in Depth.

  • Certain properties are inherited, including those for text, lists, and table borders.
  • Normal document flow refers to the default layout behavior of elements on the page. Inline elements flow along with the text of the page, from left to right, line wrapping when they reach the edge of their container. Block-level elements fall on individual lines, with a line break above and below.

    3.4.1. Collapsing between text

    The main reason for collapsed margins has to do with the spacing of blocks of text. Paragraphs (<p>), by default, have a 1 em top margin and a 1 em bottom margin. This is applied by the user agent stylesheet. But when you stack two paragraphs, one after the other, their margins don’t add up to a gap of 2 em. Instead they collapse, overlapping to produce only 1 em of space between the two paragraphs.

    Figure 4.7. The float in one container extends into the next container, allowing text in both containers to wrap around the floated element (containers highlighted with dashed lines).
    Listing 13.11. Defining fallback styles so text stuck in FOIT reappears
    body { margin: 0; font-family: Roboto, sans-serif; line-height: 1.4; letter-spacing: 0.01em; background-color: var(--extra-light-gray); } .fonts-failed body { font-family: Helvetica, Arial, sans-serif; 1 } h1, h2, h3, h4 { font-family: Sansita, serif; letter-spacing: 0.03em; } .fonts-failed h1, .fonts-failed h2, .fonts-failed h3, .fonts-failed h4 { font-family: Georgia, serif; 1 } ... .home-link { color: var(--text-color); font-size: 1.6rem; font-family: Sansita, serif; font-weight: bold; letter-spacing: 0.03em; text-decoration: none; } .fonts-failed .home-link { font-family: Georgia, serif; 1 }