SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2004
    Location
    sydney
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    floating image printing problem in IE

    Apologies if this is a really obvious one and is covered all over the place. I have had a look around, but......I realise the answer is in here somewhere.

    Anyway, I am have building a print css file so that the information site I built will print properly. Works in most browsers, just not IE, which most people use. Very handy.

    I have an image, floated to the right, text around it. When printed the image pushes the text down and it looks odd.

    A demo page can be found at www.exothermic.com.au/intranet/gatewayindex.html

    css file at http://www.exothermic.com.au/intrane.../universal.css

    I'm happy to write a print css file. Just not sure what to put in it.

    Thanks for any help.

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

    The problem is cause by ie's justify bug. Ie makes elements slightly wider than they should be when the text is justified. This can have consequences depending on the layout.

    The easier solution is just to set the text to text-align:left in your print style-sheet and the problem goes away.

    Code:
    p {
    font-size: 12px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-style: normal;
    text-align: justify;
    color: #333333;
    }
    * html p {text-align:left}/* for ie only*/
    The other solution if you want justified printout is to put the paragraphs inside another container which is smaller than the original parent container by a percent or 2. This may be awkward to achieve because the parent container has no specified width and ie hates that and would mean more hacks to get it right (e.g. height:1% on the parent).

    It may not even work with the float anyway!

    I'd just stick with left aligned text on the print out

    Paul
    [edit]
    No... Just tried it and ie doesn't like the method I mentioned above. You'll have to stick with changing the text to text-align:left on the print stylesheet.
    [/code]

  3. #3
    SitePoint Member
    Join Date
    Aug 2004
    Location
    sydney
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    thank you...

    Thanks for that, Paul.

    Left align is fine and works.





    Quote Originally Posted by Paul O'B
    Hi,

    The problem is cause by ie's justify bug. Ie makes elements slightly wider than they should be when the text is justified. This can have consequences depending on the layout.

    The easier solution is just to set the text to text-align:left in your print style-sheet and the problem goes away.

    Code:
    p {
    font-size: 12px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-style: normal;
    text-align: justify;
    color: #333333;
    }
    * html p {text-align:left}/* for ie only*/
    The other solution if you want justified printout is to put the paragraphs inside another container which is smaller than the original parent container by a percent or 2. This may be awkward to achieve because the parent container has no specified width and ie hates that and would mean more hacks to get it right (e.g. height:1% on the parent).

    It may not even work with the float anyway!

    I'd just stick with left aligned text on the print out

    Paul
    [edit]
    No... Just tried it and ie doesn't like the method I mentioned above. You'll have to stick with changing the text to text-align:left on the print stylesheet.
    [/code]


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
  •