[thelist] (X)HTML: %age widths, decimal???

rudy r937 at interlog.com
Fri Sep 6 19:22:01 CDT 2002


> can percentage widths in (X)HTML be decimal
> numbers? ie can you have width="12.3%"?

in general, sure

i have a style sheet where the font size for h1 is defined as 1.937em
(don't ask)

but in your case, i gather you want to apply it to an image width

the question then should be "is stretching an image using percentage widths
going to work the same in all browsers" and not whether percentage widths
can have a decimal portion

it might be better to set a maximum limit on how wide the poll results box
is going to be, and then calculate a pixel width based on that

after all, you probably don't want your poll results bars sticking out of
their container divs if the browser interprets the percentage width as a
percentage of the viewport rather than a percentage of its containing block

(the preceding paragraph may be total bollocks -- i just wanted to practice
some of that highfalutin language i hear the css guys speak all the time)

rudy




More information about the thelist mailing list