Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS losing structure on printing

Status
Not open for further replies.

Kalisto

Programmer
Feb 18, 2003
997
GB
ok, I suspect that this is down to my approach rather than my css, and I may need to restructure my printer output to be in tables, but before I do that I want to check :)

I have css / html that renders perfectly on screen. However, when it prints, on all pages after the first one, my clear:both div between my print elements is ignored.

On further investigation, this only happens when one of my print elements is broken with a page break. It appears that at this point, if the (floated right) div that contains prices has no more content, then on the new page, my next item is being squashed into this Right hand div.

But this only happens when printing, on screen the clear behaves perfectly.

So, other than using clear:both, are there any other suggestions to things I can try.

K
 
Lol ;-) ok, I deserved that.

I was actually trying to fish more to see if there were any issues with printing / css that I couldnt find via google.

I also didnt post code samples as the site / information is internal and confidential, so would have to have mocked something up and I was lazy.

HAving said that, I went a little more old school and it works, so if anyone finds this in the future, use a <hr> tag not a <div clear:both>, that seems to make everything behave as expected.
 
This is indeed helpful. If I ever stumble upon a strange float issue with printing internal and confidential information through an unknown printer, I will surely change parts of my code to use <hr> instead of <div>.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top