View Full Version : Limits of percentage based width's

01-03-2003, 06:48 AM

So, I have been experimenting a bit with designating percentage based width's through css (i.e. width: 85%), and was wondering just how specific I can get and still be within the "law" if you will. I have tried odd-ball percentages like 97.3% and they have worked in all the browsers I have on my comp: IE 6.0.2, Pheonix 0.4, Mozilla 1.2a, and Netscape 6.2.3. Is it okay to use percentages with decimal places like that? It seems wierd, but in the end, it works!

01-03-2003, 12:52 PM
well... seeming as you cant do half pixels i imagine it wouldnt work with fixed widths... although with percentages, because nobody really has screen resolutions of < 100x* in thoery it probably shouldnt be a problem... but... i'd never decimal places in percentage of width, i'd stick with intergers ;)

01-03-2003, 04:34 PM
Ultimately, I think browsers are obligated to support 3 decimal places (maybe this is only in SVG however).


Which ultimately says that a percentage can start (optionally) with a "+" or "-", followed by a rational number (any integer, or a number with an arbitrary amount of decimal places), and followed by a "%".

So yeah, decimal percentages are fine. :)

01-03-2003, 06:34 PM

Thanks much for the replies. I had thought about the fact that you can't do half-pixels but if you think about it, if a person's screen is 1000px in length (I know it's not a real resolution, but it's easy to work with), 97.3% would be 973px. Thus it doesn't imploy any half-pixel shananigans and seems like it would work just fine.

So in the end, I am agreeing with jkd (just like always)! :)

01-03-2003, 07:16 PM
So in the end, I am agreeing with jkd i think i am too ;)