mardi 6 décembre 2016

vertically centering for inner div doesn't work nice in firefox. with flex for outter div

I write this simple code to centering inner div:

<html>
<head>
</head>
<body>
  <div style="display: flex;align-items: center;width: 100%;height: 600px;background-color: gray;">
    <div style="background-color: white;width: 100px;height: 100px;position: absolute;"></div>
  </div>
</body>
</html>

And it works fine in chromium. but not in firefox.
in firefox inner div is not in center.
firefox:

enter image description here

Chromium:

enter image description here

I need inner div remain in absolute position.




Aucun commentaire:

Enregistrer un commentaire