would like to center the muddy dog paws dropdown menu. anyone have a solution to center the ul for the menu within a div?
thanks! chas
I tried and failed with margin etc. in the end I just added some padding left to the main <ul>.
Someone else might have a fix.
that is where i started and where i ended up after sifting through a lot of posts about centering ul’s in divs - didn’t find much help! am hoping someone has a little more elegant solution.
looks like that would work in simple situations. tried applying the technique both outside the menu and within the dropdown menu. seems there are some other "forces" at work within the css for the menu itself that complicate the issue. the closest i can get is centered in a vertical list. any horizontal layout has the ul claiming 100% of it’s container. *sigh* unfortunately, my css skills are not at the same level as the menu and so far trial & error has not gotten me to a centered menu.
thanks for the suggestions.
-
MODX Staff
- 12,272 Posts
ULs are block elements by definition and unless given explicit widths will take 100% of the width of their containing element.
CSS is both incredibly simple and incredibly deep. Kinda like MODx!
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Has anybody had any success with this?
-
☆ A M B ☆
- 1,231 Posts
I’m not entirely sure if I understand what you are trying to do...
style="margin:0px auto" is one way to center elements, another is style="text-align:center" (yes this does work for than just text) or have you tried creating a further div around the menu and using one of the 2 styles for that div to force the elements within, to center?