Yahoo India Web Search

Search results

  1. Learn how to set different font weight for text using the font-weight property in CSS. See examples, syntax, values, browser support and related pages.

    • yes. Read about animatable Try it
    • yes
    • normal
    • CSS1
    • Overview
    • Syntax
    • Accessibility concerns
    • Browser compatibility

    The font-weight CSS property sets the weight (or boldness) of the font. The weights available depend on the font-family that is currently set.

    Values

    normal Normal font weight. Same as 400. bold Bold font weight. Same as 700. A value between 1 and 1000, both values included. Higher numbers represent weights that are bolder than (or as bold as) lower numbers. This allows fine-grain control for variable fonts. For non-variable fonts, if the exact specified weight is unavailable, a fallback weight algorithm is used — numeric values that are divisible by 100 correspond to common weight names, as described in the Common weight name mapping section below. lighter One relative font weight lighter than the parent element. Note that only four font weights are considered for relative weight calculation; see the Meaning of relative weights section below. bolder One relative font weight heavier than the parent element. Note that only four font weights are considered for relative weight calculation; see the Meaning of relative weights section below.

    Fallback weights

    If the exact weight given is unavailable, then the following rule is used to determine the weight actually rendered: •If the target weight given is between 400 and 500 inclusive: •Look for available weights between the target and 500, in ascending order. •If no match is found, look for available weights less than the target, in descending order. •If no match is found, look for available weights greater than 500, in ascending order. •If a weight less than 400 is given, look for available weights less than the target, in descending order. If no match is found, look for available weights greater than the target, in ascending order. •If a weight greater than 500 is given, look for available weights greater than the target, in ascending order. If no match is found, look for available weights less than the target, in descending order.

    Meaning of relative weights

    When lighter or bolder is specified, the below chart shows how the absolute font weight of the element is determined. Note that when using relative weights, only four font weights are considered — thin (100), normal (400), bold (700), and heavy (900). If a font family has more weights available, they are ignored for the purposes of relative weight calculation.

    People experiencing low vision conditions may have difficulty reading text set with a font-weight value of 100 (Thin/Hairline) or 200 (Extra Light), especially if the font has a low contrast color ratio.

    •MDN Understanding WCAG, Guideline 1.4 explanations

    BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

  2. Mar 2, 2023 · Learn how to use the font-weight property to create bold text in HTML using inline, internal or external CSS styling. Follow best practices for choosing the right font-weight, balancing bold text with other formatting options, and testing for accessibility.

  3. People also ask

  4. Jun 17, 2013 · The font-weight property sets the weight, or thickness, of a font and is dependent either on available font faces within a font family or weights defined by the browser. span { font-weight: bold; } The font-weight property accepts either a keyword value or predefined numeric value. The available keywords are: normal. bold.

  5. Feb 8, 2024 · Learn how to use HTML tags, CSS properties, and font weights to make your fonts bold in web development. Find out the difference between b and strong, and how to adjust font-weight with numbers or relative values.

  6. Learn how to use the font-weight property to adjust the lightness or boldness of the text in a webpage. See the syntax, values, examples and browser output of font-weight.

  1. Searches related to how to bold text in css

    how to bold text in html