Solved

Align vs Float IE Print

Posted on 2007-11-25
6
941 Views
Last Modified: 2008-09-26
Hi all, something strange here. I know that most people use IE so I'm hoping to get this issue sorted.

I have re-written my complete site so to be complete CSS and have come across yet another problem with IE 6.

THe site is written to comply with <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

And it passes so I'm very pleased.

The problem is that if I have an image float left, and <p>CONTENT</p> to the right, and try to print the page in IE6 the <p>CONTENT</p> drops below the floated image.  If I use align left, all works fine but then I am not complying with the rules of xhtml strict so the page fails.

I've also noticed that I seem to have no problem with <h1> and <h2>.

Now the question is, am I doing something wrong or is this yet another bug up the bum of IE?

Any ideas would be appreciated.

AJ  
0
Comment
Question by:jezella
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 

Author Comment

by:jezella
ID: 20345979
Perhaps a bit of my code would help.

<div id = "MainContent">
<img src = "/site-images/home-page/welcome-page-header.jpg"
alt = "Ashley Wedding Cars where Quality Still Matters"
width = "477"
height = "295"
class = "MainImageTL"/>

<h1 id="H1AlignR" class="InitialHeading">Wedding Cars for Surrey, Sussex, Berkshire, Bucks, Kent, Middlesex
                                    and the London Boroughs.</h1>

<h2 id="H2AlignR">Specialists in Wedding Transport</h2>
                                    
                                    
<p class = "FirstPara">
            <img src = "site-images/fonts/a.jpg"
                         width = "56"
                                           height = "45"
                                           alt = ""
                                           class = "CapitalImage"/><span class = "NeverShow">A</span>shley Wedding Cars                  
0
 
LVL 29

Expert Comment

by:Göran Andersson
ID: 20346054
If you just float the image to the left, the other elements doesn't have to the floated, they would just flow around the image.

Try if that works better.
0
 

Author Comment

by:jezella
ID: 20346080
Hi GreenGhost.  Everything works fine on screen in IE6, FF and Opera.  Print is ok in FF and Opera.  The problem is in IE.  Have a look at how print preview look in IE6 with this link.

http://www.website-design.org.uk/about-us.php
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 29

Accepted Solution

by:
Göran Andersson earned 500 total points
ID: 20346239
Yes, I know. It looks the same in IE7.

Upon examining your code closer, I see that you don't float the elements to the right, your are using an incorrect value for display:

display: right;

This has no effect what so ever (other than preventing the css from being valid). You should validate the css anyway, there are some more mistakes in there...

http://jigsaw.w3.org/css-validator/

I don't know exactly why, but when IE does the layout for the print, it thinks that there is not enough room for your text. If you make the image smaller (I think it's too big in the printout anyway), it works just fine.

Add this to the #MainContent img.MainImageTL style in the print css:

width: 400px;
height: 220px;
0
 

Author Comment

by:jezella
ID: 20347522
GreenGhost, the display:right should read text-align:right; All the messing with the code and I made a mistake.  Apart from that, I have tried making the image smaller but this does not help as the <p>text</p> still does not flow around the image.  However, the <h1> and <h2> does.

Any other ideas.  Anyone.

AJ
0
 

Author Comment

by:jezella
ID: 20347618
OK fixed it.  If I take out  text-align:justify; from my print style sheet I no longer have the problem.  It seems that IE can't justify text around floated element in print mode.

AJ
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question