22

When someone makes fun of UI development, and you challenge him to vertically center align a div. Challenge accepted and lost :D

Comments
  • 2
    It's achievable with a wrapping div of
    display:table;
    vertical-align:middle;
  • 2
    Or set the margin-top and call it a day, works on my screen...
  • 1
    @datahack That's really dependant on the content in said div
  • 0
    css.... 👎👎👎
  • 1
    Good UI developers are amazing. I love working with someone who's good at making a UI.
  • 0
    if the parent element does have a height, I rely on top: 50%; and transform: translateY (-50%);
    well.. most of the times, at least.. display table and table-cell breaks layout and gives limitations
  • 0
    Hardest damn thing in the programming world.
  • 0
    That's what flexbox is for.
  • 0
    . AbsoluteCenter
Add Comment