Results 1 to 4 of 4

Thread: font bgcolor css

  1. #1

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    font bgcolor css

    I need to set the font backgroundcolor via css but there are no tags assosiated with the font can i do that ?

    also i have font in a td table, and want to set that fonts backcolor also but not affect the td

  2. #2
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: font bgcolor css

    I can't find a way to make it so that all text in the body has a certain background color, but you could just use the Paragraph tag and change the text and background color from there.

    P {color: orange ; background-color: blue}

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: font bgcolor css

    Wrap the text in a span and apply background to that.

    HTML Code:
    <span class="highlighted">This text should appear with yellow background</span>
    Code:
    .highlighted
    {
      background: yellow;
    }
    As the span tag is displayed inline it will only occupy the space containing the text and not expand its height or width to fit the containing element like a block element would.

  4. #4

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Re: font bgcolor css

    thanks guys, both suggestions are fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width