Forum › Bugs

css percents and floats

bengert
I'm having some minor issues with a div and I think it's a rendering bug the odd thing is it's not consistent. The premise is I have a div that's 50% wide. In that div I have two divs one is 30% the other is 70% but the left 50% get stacked as if they are too wide to fit. I have a feeling the issues has to do with precision of percents.

I've attached a example html and css that shows the issue.
  1. test.css‎ 0.6 kB
  2. test.htm‎ 1.1 kB
mikeday
Yes that is most likely the issue. What if you reduce them to 49%?
bengert
Changing the 50% wide divs to 49 does not help. The issue seems to have to do with the parent container that's using "box-sizing: border-box;".
mikeday
I get this PDF file, which looks the same as Firefox output:
  1. test.pdf‎ 10.2 kB
bengert
that's odd because hello is not in the html. I've attached what I get.
  1. test.pdf‎ 29.5 kB
mikeday
Sorry, I attached the wrong PDF file! See the correct one below.

Which version of Prince are you running, and on which platform?
  1. test.pdf‎ 32.0 kB
bengert
I'm running 9.0r4 on windows 7. I upgraded to 9.0r5 and I'm still observing the same issue.
mikeday
Right, it appears to be a numerical accuracy issue. Dropping the .participant .value to 69% width instead of 70% fixes the problem. (The 50% width of the parent was unrelated, as it is the label/value child boxes that are unable to fit).
bengert
I just tested on a mac running 10.9 and it renders just like the pdf you attached. I also tested it on a debian server and it renders a like it did on windows.
  1. test.pdf‎ 18.7 kB ‎
    Debian and prince 9.0r5