Forum Bugs

CSS grid calculations a bit off

27escape
I have a basic css 12 column grid, with percentages stolen from bootstrap, works fine in a browser but....

when I convert to PDF, there are a couple places where it falls down

it I do col2 col10 it works fine, however if I do col10 col2 it fails.

Also if I do 6 col_sixth it fails, all the other combinations seem to work fine

Any suggestions as to where I am going wrong?

Many thanks
kevin
  1. grid.html6.8 kB
    Basic HTML grid
27escape
Answering myself

Thinking about it a bit and changing my container width to be 708 (multiple of 12) fixes the 10/2 spans but then breaks 11/1, the sixths are still broken.

Knowing the absolute width of the container means that I could cheat/work around and calculate all the px sizes rather than have them as percentages, not ideal though
mikeday
This is a tricky issue which usually requires reducing the percentages by a tiny amount to avoid overflow.