css - Center Parent Div around child div element (reverse inheritance?) -
i'm struggling centering menu made of different sized divs following site: https://robert-wainblat.squarespace.com/ . wrapper (parent div - ul.nav.clear) centers properly, child divs (menu buttons) within wrapper. issue don't want buttons distributed equally around on virtual center, home button center , align center of logo beneath it, pivot, , have other buttons align around it:
__________________________________________ | 1 2 3 4 home 5 6 7 8 | ------------------------------------------ is possible? other option can think of hard code top 10 resolution widths , adjust margin-left make home button appear centered.
here's css menu right now:
.primary-nav .nav { /*this parent div;*/ width: 100%; position: relative; margin-left: 5.34%; - using tweak position current resolution padding: 0; text-align: center; background-color: rgba(19, 19, 19, 0.9); z-index: 1001; background-attachment: scroll; list-style-type: none; } all immensely appreciated!
thanks!
the way comes mind separate 2 sides individual containers, right-align left side, left-align right side, , add enough padding containers leave gap absolutely-positioned home.
#menuleft { width:50%; text-align:right; padding-right:75px; box-sizing:border-box; } #menuright { width:50%; text-align:left; padding-left:75px; box-sizing:border-box; } #menuhome { position:absolute; left:50%; margin-left:-75px; width:150px; text-align:center; }
Comments
Post a Comment