pre tag not working in IE !!!

Discussion in 'HTML & Website Design' started by nicelk, Nov 23, 2009.

  1. #1
    I have a blogspot blog.I am using the pre to display the contents/codes.But it is not work fine on IE,but it is work fine Firefox.So I use pre {word-wrap:normal;} into my template.Now in IE display codes correctly.But when someone copy the codes there are no white spaces.So many codes doesn't work fine.There are over 500 blog posts on my blog.This is a big problem to me.

    Please help me !!!
     
    nicelk, Nov 23, 2009 IP
  2. shubhamjain

    shubhamjain Active Member

    Messages:
    215
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #2
    Try "white-space: pre-wrap" .
     
    shubhamjain, Nov 24, 2009 IP
  3. nicelk

    nicelk Member

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Thank you for your reply.But it doesn't work.Have any idea?
     
    nicelk, Nov 24, 2009 IP
  4. unigogo

    unigogo Peon

    Messages:
    286
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Can you post a link?
     
    unigogo, Nov 24, 2009 IP
  5. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You need to say what "doesn't work" with pre. In general, the pre tag should work in IE, though I have noticed that I'll need to manually make line breaks in code to keep long lines fitting on the web page (difference seems due to font sizes).

    The purpose of <pre> is to preserve whitespace. Is IE not doing that?

    Normally pre is
    white-space: nowrap;
    by default but you can add it manually.

    Are you sure you don't have a conflict where something else is set to
    word-wrap: break-word;
    ?

    This is a (previously) IE only command (now that it's been added to CSS3, Safari supports it now as well).
     
    Stomme poes, Nov 24, 2009 IP