首页 > 其他 > 详细

背景图自适应浏览器窗口两种方式分享

时间:2018-07-12 19:02:46      阅读:167      评论:0      收藏:0      [点我收藏+]
方式一:
<html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> html{ height: 100%; } body{ padding: 0; margin: 0; background: url("http://tpc.googlesyndication.com/daca_images/simgad/1628755112086520131") no-repeat; background-size: 100% 100%; position: absolute; } </style> </head> <body> </body> </html>

方式2:


<html>
<head>
<title>自适应</title>
<meta charset="utf-8" />
<style type="text/css">
html{
height: 100%;
}
body{
padding: 0;
margin: 0;
background: url("images/bg.jpg") no-repeat;
background-size: 100%;
position: absolute;
}
</style>
</head>
<body>
111
</body>
</html>

 

背景图自适应浏览器窗口两种方式分享

原文:https://www.cnblogs.com/lhl-shubiao/p/9301005.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!