styling text

Discussion in 'CSS' started by Alan Murray, Aug 6, 2007.

  1. #1
    I am styling text with css but how do I get a different colour background for just the text. I.e. the area of the text a different colour not the actual background of the page.

    Hope this makes sence.
     
    Alan Murray, Aug 6, 2007 IP
  2. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #2
    <span style="background-color: #ffff00;">Yellow background</span>
     
    krt, Aug 6, 2007 IP
  3. euler

    euler Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ... style="background-color:#yourcolorcode;">
     
    euler, Aug 6, 2007 IP
  4. PadraigCurran

    PadraigCurran Peon

    Messages:
    250
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    <p class="color">The text you want with a background color</p>

    .color {
    background: #c00;
    }

    This will give the text a red background.
     
    PadraigCurran, Aug 6, 2007 IP