My entire page is fluid and based on percentages. The only issue is that a critical part of my page uses 12.5%, which FireFox/Chrome round down to 12%, thus entirely messing up the look/layout of the page. As such, the solution I thought of is instead of using a 100% page width, change the page width respective of the user’s screen resolution (please let me know if there is a better method I can use to not have to worry about this .5% issue). Here is the code I have so far:
I forgot to mention–the reason that the layout becomes messed up due to this half percentage is because it is not a fixed width, so as such, when you multiply .125 * screen resolution, it involves decimal points which get rounded down by webkit browsers, thus messing up my neat looking layout.
If you want fluid designs, you may have to think differently about layouts. Trying to lock down the layout at so many screen widths is impractical. It’s better to design your elements so that they can afford to be more fluid. If you have fixed width elements, just choose a break point at which the layout of elements just can’t work any more. Like when you have a flexible width element next to a fixed width element. At some point, the flexible element will become too narrow, at which point you just need to drop it below or whatever.
Thanks Ralph! Actually, the entire page and all its elements are fluid. Originally, the page width was 100%, but then I made it as I described above (fixed) to get rid of this issue of Webkit browsers rounding down from 12.5% to 12%.
In any case, you’re right that perhaps I should rethink my design. I’m going to see if I can just make my element work at 12% instead of 12.5%.
Ultimately, browsers have to calculate everything in px, and some times they will have to do a bit of founding. So you need to leave a bit of room for this, unless you specify your break point in px rather than in %.
Yes, you’re right. I’m experiencing the same issues now with 12% as I was with 12.5%. How bad or wrong is it if I try to lock down the layout at dozens of various screen width ranges? What’s the worst that can happen?