How can I make font that is bold a certain colour

Discussion in 'CSS' started by Glen, Mar 31, 2007.

  1. #1
    How would I do this with CSS?

    Thanks in advance
     
    Glen, Mar 31, 2007 IP
  2. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #2
    strong {color:#yourHexColour }

    Another example, not using hex colours;

    strong {color:blue}

    You may need to up the specificity though. Specificity is about being more precise when defining your css properties. For example, maybe the strong tag is inside a paragraph (it usually is);

    <p>lalalal <strong>this will be bold</strong> lalal </p>

    if you apply in the css;

    strong {color:blue}

    Then after write

    p {color:black}

    The paragraph will all be black.

    If however you do this:

    p strong {color:blue}
    p {color:black}

    You're being more specific by telling it each strong element inside the paragraph, is blue.

    Hope that helps.
     
    AdamSee, Mar 31, 2007 IP
    WunschShrek likes this.
  3. WunschShrek

    WunschShrek Peon

    Messages:
    629
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Great post, thank you, I am just learning CSS and helped understand a lot of new things.
     
    WunschShrek, Apr 4, 2007 IP