python基础一 51

如何铺满整个屏幕和一直居中
<!
DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> *{ margin: 0; padding: 0; } .c1{ /*width: 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>

 

posted @ 2019-09-08 22:00  谭文章  阅读(139)  评论(0编辑  收藏  举报