absolutly positioned div with inline elements inside
Posted: Thu Aug 11, 2005 5:43 pm
Hi
i have javascript popup menu... here is how it looks in IE with one submenu open...

and here the same menu and how it look in firefox:

submenu declared as:
.submenu{position:absolute}
(its left and top coordinates are calculated with js)
and parent menu (with 'Articles' highlighted) declared as:
.rootmenu{position:relative}
so that the very first menu is positioned with document normal flow...
if you not already see, the problem is that firefox renders submenu in strange way... instead of placing menu entries one next to other like ie does. (in ff menu entries even stick out of submenu itself.)
I realize that i didn't specify 'width' on submenu... but this shouldn't be the problem(only floats require explicit width)
another thing i tried is to give submenu specific width say 300px... and now firefox renders it ok...but this is not the way...because each submenu can contain different number of entries...
one way to fix would be looping through children of submenu and summing up their offsetWidth and using total as the needed width...
but i want to understand why firefox renders submenu the way it does..
i have javascript popup menu... here is how it looks in IE with one submenu open...

and here the same menu and how it look in firefox:

submenu declared as:
.submenu{position:absolute}
(its left and top coordinates are calculated with js)
and parent menu (with 'Articles' highlighted) declared as:
.rootmenu{position:relative}
so that the very first menu is positioned with document normal flow...
if you not already see, the problem is that firefox renders submenu in strange way... instead of placing menu entries one next to other like ie does. (in ff menu entries even stick out of submenu itself.)
I realize that i didn't specify 'width' on submenu... but this shouldn't be the problem(only floats require explicit width)
another thing i tried is to give submenu specific width say 300px... and now firefox renders it ok...but this is not the way...because each submenu can contain different number of entries...
one way to fix would be looping through children of submenu and summing up their offsetWidth and using total as the needed width...
but i want to understand why firefox renders submenu the way it does..