Home › Forums › CSS › Center ul in li element › Reply To: Center ul in li element
October 14, 2014 at 2:57 pm
#186234
Member
OK…I think I figured it out.
I’ve commented out a few lines so we can see what’s actually happening.
You have to position the ul
at 50% left and the translate it back 50% of it’s own width
top: 100%; /* it'll always adjust regardless of parent height */
left:50%;
transform:translateX(-50%);