其他分享
首页 > 其他分享> > 如何让一张背景图充满整个屏幕

如何让一张背景图充满整个屏幕

作者:互联网

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta content="width=device-width, height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"> <title>测试页面</title> </head> <style> html,body { margin:0; padding:0; overflow: hidden; } /* 背景图 */ .content { width: 100%; height: 100%; top:0; z-index: -1; position: absolute; background: url(jrback.jpg) no-repeat; background-size:100% 100%; } .d1{ width:100%; display: flex; text-align: center; justify-content: space-around; margin-top:70%; } .d2{ width:100%; display: flex; text-align: center; justify-content: space-around; margin-top:10%; } .widths{ width:50%; } .colors{ color:#fff; font-size: 1rem; } .small_pic{ width:100%; } .small_pic_1{ width:50%; } </style> <body> <div class="content"> <div class='small_pic'> <div class='d1'> <div class='small_pic_1'> <div><img class='widths' src="tx1.jpg" alt=""></div> <span class='colors'>总行(会,司)<br>报名通道</span> </div> <div class='small_pic_1'> <div><img class='widths' src="tx2.jpg" alt=""></div> <span class='colors'>省(区,市)金融工会<br>报名通道</span> </div> </div> <div class='d2'> <div class='small_pic_1'> <div><img class='widths' src="tx3.jpg" alt=""></div> <span class='colors'>座次表</span> </div> <div class='small_pic_1'> <div><img class='widths' src="tx4.png" alt=""></div> <span class='colors'>会议安排</span> </div> </div> </div> </body> </html>

标签:margin,top,充满,content,width,text,屏幕,背景图,100%
来源: https://www.cnblogs.com/maibao666/p/11140088.html