Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Align vs Float IE Print

Posted on 2007-11-25
6
Medium Priority
?
945 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
Industry Leaders: 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 2000 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

618 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