Yeah this was really fiddly and gets different rounding errors in different browsers. I was trying really hard to avoid absolute positioning. I'll keep fiddling and maybe find a better solution.