码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-07-12 20:03:01      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:分享   url   html   googl   com   absolute   images   osi   .com   

方式一:
<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>

 

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

标签:分享   url   html   googl   com   absolute   images   osi   .com   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!