Why not put the menu is a DIV?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
vikenk
Mega Advanced
Mega Advanced
Posts: 297
Joined: Tue Nov 29, 2005 7:38 pm

Why not put the menu is a DIV?

Post by vikenk »

Hello all,

Just a technical question mostly to satify my curiosity. I've read repeatedly that the menu does not like to be in a <div> and should be used in a table for relative positioning.

Why? What is it about a <div> that the menu doesn't like? In my (admittedly limited) experiments, there seems to be no adverse affect to the menu being in a div. But again, my experiments were limited and not taking in to account the many different applications its used for.

Just curious. One can never learn enough :>)

Viken K.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Viken,

How's it going?

Here's my not very technical explanation since I don't have the indepth knowledge of divs and all the browsers and how each 'treats' them nor the technical terms.

Think about divs and using divs for your layout, if you check around you'll see that you have all these kind of 'hacks' for div layouts, IE HACK, Mozilla Fix [interesting it's a hack for IE and a Fix for Mozilla :lol: ] That's to make the div function the same in different browsers, as far as I can understand it's because different browsers do different things with regard things like postion:absolute [relative, static, fixed or whatever it might be]

The menu itself contains divs, spans, tables, and I don't know what all else. So, what happens in some browsers, or perhaps do to something that the person coded with regard to their div, the menu can have a problem, usually it's a problem related to where the submenus end up being positioned.

Hope that helps, though I do admit, I'm not real technical on my explanation.

Ruth
vikenk
Mega Advanced
Mega Advanced
Posts: 297
Joined: Tue Nov 29, 2005 7:38 pm

Post by vikenk »

Ruth wrote:Hi Viken,

How's it going?
It's going well. I can't complain. Even if I did complain, it would fall on deaf ears! LOL :>)
Think about divs and using divs for your layout, if you check around you'll see that you have all these kind of 'hacks' for div layouts, IE HACK, Mozilla Fix [interesting it's a hack for IE and a Fix for Mozilla :lol: ] That's to make the div function the same in different browsers, as far as I can understand it's because different browsers do different things with regard things like postion:absolute [relative, static, fixed or whatever it might be
That makes sense. I suppose that browser support for tables is much more stable than for div's, since there's no interpretation of how a table should be rendered. So putting the menu in a table would mean more stability. I think most of the <div> instability comes because IE doesn't display the "Box Model" to html/css specs. However, IE 6 will display a proper box model if a full DOCTYPE is used.
[interesting it's a hack for IE and a Fix for Mozilla :lol: ]
I know. The anti-IE sentiment is sometimes amazing. I like IE, personally, but I am disppointed that IE does not fully support CSS2, since there so many cool CSS2 commands that can be used, many of which don't work in IE. Maybe IE-7 (or whatever the next version will be) will address that.
Hope that helps, though I do admit, I'm not real technical on my explanation.
That's good enough for me :>) Although, if anyone else wants to chime in (ahem....Andy) with a somewhat technical explanation, I'll be willing to listen, even though I may not understand it all :>)

Viken K.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hiya,
vikenk wrote:It's going well. I can't complain. Even if I did complain, it would fall on deaf ears! LOL :>)
Ain't that the truth!

I also like IE. As to the CSS 2, given CSS3 is on the way, maybe their just moving in that direction, or not :) There's so much else, like the filters, transitions and so on, maybe that just kind of gets lost in the development fixes?

Andy actually did explain it to me once. I can't find the info, and have OAS with CRS complication [Old-age Syndrome and Can't Remember S... ah stuff] :lol:
Post Reply