Highlighting Text Background

Discussion in 'HTML & Website Design' started by Requiem, Aug 27, 2008.

  1. #1
    I know how to do it with this method.. <FONT STYLE="BACKGROUND-COLOR: #FFFF00">, but it doesn't show the highlighting in Firefox. Is there a cross-browser standard for doing this?
     
    Requiem, Aug 27, 2008 IP
  2. risoknop

    risoknop Peon

    Messages:
    914
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What you use isn't standards compliant and has been obsolete for years already. Try something like this:

    
    <span style="background:#ffff00;">Highlighted text</span>
    
    Code (markup):
     
    risoknop, Aug 27, 2008 IP
  3. Requiem

    Requiem Peon

    Messages:
    172
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    edit: nm, it worked when I stripped out some other stuff. :D
     
    Requiem, Aug 27, 2008 IP
  4. SearchBliss

    SearchBliss Well-Known Member

    Messages:
    1,899
    Likes Received:
    70
    Best Answers:
    2
    Trophy Points:
    195
    Digital Goods:
    1
    #4
    Do what risoknop said or just visit a Google cache, view source, and see how they highlight the background.
    <b style="color:black;background-color:#ffff66">
    Code (markup):
     
    SearchBliss, Aug 27, 2008 IP
  5. CaveBoss

    CaveBoss Active Member

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #5
    You should try what risoknop says. You could also have the background color attribute in an external CSS file and then reference it using classes in your HTML. That way, if you ever decide to change the yellow background to red (due to theme color style or similar), you'd just need to change it in one place.

    Google is not known for having standards compliant code :)
     
    CaveBoss, Aug 27, 2008 IP