python基础一 51

如何铺满整个屏幕和一直居中
<!
DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> *{ margin: 0; padding: 0; } .c1{ /* 100%;*/ /*height: 100px;*/ background-color: red; position: fixed; /*position: fixed;*/ top: 0; right: 0; left: 0; bottom: 0; } .c2{ width: 600px; height: 400px; background-color: white; position: fixed; top: 50%; left: 50%; margin-top:-200px; margin-left:-300px; } </style> <title>工会公告</title> </head> <body> <div class="c1"></div> <div class="c2"></div> <!--<p>sdd</p>--> </body> </html>
原文地址:https://www.cnblogs.com/wang-tan/p/11488779.html