PDA

View Full Version : style="height:100%px;"


piz
06-24-2003, 09:53 PM
Hi,

I have a page made of some tables, where i noticed, that Mozilla (don't know how it does NS6) makes a difference between those three style-values in a normal td:

style="height:100%;"
style="height:100px;"
style="height:100%px;"

And coincidently the third result is the only one which displays my page as i like.

Is this just a crazy Browser-Bug?
Or should there be a difference between thos three ways of writing the style?
If yes, what does %px exactly do?

Thx
Saludo
piz

oracleguy
06-25-2003, 12:17 AM
Obviously the first two would be different. If the parent element is 500px wide, 100% would mean 500px and 100px would mean only 1/5 the space.

But as for the third, I don't know Mozilla that well as some other members, perhaps one of them could be kind enough to reply.

giz
06-25-2003, 01:13 AM
Whatever happens, %px is not valid code. You cannot have two units on a number.

piz
06-25-2003, 01:45 AM
Yes, i know the difference between px and %, and i know (or i supposed) that px% is not valid.

But - you'll know that - working with tables it happens often that the tablecells appear too large, even if you put height/width="something" or style="height/width:something".

This time I wanted a cell with height="100%" - but Mozilla had problems, depending on the height of another table in another cell of the main table, other rows (different rows) changed their height.

style="height:100%" didn't change anything.

I am generating the code half-automatically with PHP and trying some things, finally it worked. I looked at the resulting HTML Code and my PHP Script put there the 100% and the "px" i added (in my function which generates my code).

And 100%px solved the problem.

You say it isn't valid code - i supposed that. So it is a crazy Browser-Bug... :-)

I am Using Mozilla 1.0.

Saludo
piz

meow
06-25-2003, 04:39 AM
And what happens if you don't set a height? Because that's what 'style="height:100%px' probably accomplishes - the declaration should be ignored. :p

piz
06-26-2003, 01:34 PM
lol... yes, it seems to be that...
my god, why i didn't try that... :rolleyes:
forget my question... :o