Forum Moderators: not2easy

Message Too Old, No Replies

css hack float solution needed for printing

         

risingsun

7:31 pm on Sep 7, 2005 (gmt 0)

10+ Year Member



I am using a hack float:

* html #content {
overflow-x: auto; overflow-y: hidden;
width: 60%;
margin-right:-100%;
height:inherit;
}

My content style is:
#content {
padding: 15px 15% 15px 25px;
margin-left: 12.7em;
margin-top: 0px;
height:1%;
clear: none;
float: none;
background-color: #FFFFFF;
}

Looks fine on all browsers, but I'm having problems printing out only on PC browsers. The "content" section using this hack float prints out blank. Is there any way around this problem?

Please reply and thanks for any help.
RisingSun

jetboy

7:43 pm on Sep 7, 2005 (gmt 0)

10+ Year Member



If I were you I'd produce a print-only stylesheet without any negative margins, 1% heights and non-default overflows and see what that looks like.

createErrorMsg

7:46 pm on Sep 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure what you mean exactly by "hack float"...? Regardless, printing issues are usually browser based. For instance, FF has a print bug where only a single page of content contained in a floated element will print. The rest of the pages will be spit out of the printer with nothing on them.

I'm suprised to hear you say that the posted code displays well on screen. With a 1% height value, the only browser that will display much of anything for that div is IE, which auto-expands an element to contain it's content. A compliant browser like FF or Opera will display that div at 1% ONLY, no matter how much is in it. Perhaps this is the root of your printing problem?

More details about exactly what's happening when you print from each browser would help.

cEM

risingsun

8:59 pm on Sep 7, 2005 (gmt 0)

10+ Year Member



Thanks for your help. I found my mistake in my main style sheet which was currently over riding my print style. Thanks again. RS