html实现像百度的首页效果一样的背景图(代码)

互联网 18-10-24
本篇文章给大家带来的内容是关于html实现像百度的首页效果一样的背景图(代码),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。

里面的图片是我随便找的。

<!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <title></title>     <style>     html,     body {         height: 100%;     }     body {         margin: 0;         background-repeat: no-repeat;         background-size: cover;         background-position: center;         background-attachment: fixed;         background-image: url(http://pic1.win4000.com/wallpaper/b/589d687069ed9.jpg);     }     h1{         height: 100%;         width: 100%;         margin: 0;         padding: 0;         color:#fff;         background-color: rgba(0,0,0,0.5);         display: -webkit-flex;         display: -moz-flex;         display: -ms-flex;         display: -o-flex;         display: flex;         justify-content: center;         align-items: center;     }     </style> </head> <body>     <h1>按住Ctrl+滚动滚轮:可以看到文字缩放,背景不动</h1> </body> </html>

以上就是html实现像百度的首页效果一样的背景图(代码)的详细内容,更多内容请关注技术你好其它相关文章!

来源链接:
免责声明:
1.资讯内容不构成投资建议,投资者应独立决策并自行承担风险
2.本文版权归属原作所有,仅代表作者本人观点,不代表本站的观点或立场
标签: html
上一篇:php获取远程图片并下载保存到本地的方法分析 下一篇:css+html如何仿花瓣网实现静态登陆页面?(代码实例)

相关资讯