SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,466
    Mentioned
    61 Post(s)
    Tagged
    2 Thread(s)

    IE9: p {white-space:pre-wrap} vs img {float:left|right}

    Bad code or IE9 bug?

    IE9 behavior: with p {white-spacere-wrap} in a floating environment, IE9 renders a word on every line. It does not skip lines where the width is too short for the first word; instead, text on those lines overflows the right edge of the container or the left edge of the image. Text intrudes on the preceeding and succeeding images on the right side of the floated objects.

    Test page and IE9 screen shot attached (hopefully. I'm new at this.)
    Attached Files Attached Files

  2. #2
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,466
    Mentioned
    61 Post(s)
    Tagged
    2 Thread(s)
    Screen shot didn't "stick" in first post. 2nd try.
    Attached Images Attached Images

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,288
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    It does look as though that's a bug in IE9 and removing the pre-wrap allows the text to wrap as per other browsers albeit with the loss of the white space you added.

    I see white space in a document to be presentation issue and I would add the white space with css (use a span and padding/margins for inline elements) rather than putting spaces in the document which will always be upset if someone edits or reformats the content accidentally. Unless of course its something like a code block that has been inserted where you need to preserve the structure.

    I couldn't see a fix for IE9 anyway so you will either have to remove the rule for IE9 only or allow for the white space to be created with css/html instead.


Bookmarks

Posting Permissions

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