CSS3实现登录窗口水平垂直居中显示
<!DOCTYPE html> <html> <head> <style> .flex-container { position: absolute; display: flex; justify-content: center; align-items: center; background-color: DodgerBlue; left: 0px; top: 0px; right: 0px; bottom: 0px; } #login { background-color: #f1f1f1; width: 400px; height: 280px; } </style> </head> <body> <div class="flex-container"> <div ></div> </div> </body> </html>
- 上一篇 »css3实现水平、垂直居中
- 下一篇 »css样式设置高度不定文本垂直居中