Horiz/Vert menu best practices question

I’ve been looking at various websites with examples of Vertical and Horizontal menus (sometimes called lists or “navbars”)

Usually there will be code for a class (or ID) given, and sometimes the class (or ID) is placed in the containing DIV, and sometimes it’s placed in the UL.

Why? Do some menus simply format better if the CSS is referenced in the DIV vs UL ?

Is there a “best practices” that suggests it should be in the DIV or UL ? (Thanks)