时间:2023-04-24 13:15:01 | 来源:网站运营
时间:2023-04-24 13:15:01 来源:网站运营
教你用html和css仿制小米官网页面!:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>小米商城(假的)-小米10Pro</title> <link rel="stylesheet" href="style.css"></head><body> <!-- 奔跑的熊 --> <div class="bear"> <div class="xiaopingzi">小瓶子出品</div> <div class="bear_box"> </div> </div> <!-- 网页头部开始 --> <div class="ssp"> <a href="none.html"> <div class="banner1 clearfix"> <a href="none.html"> <img src="tupian/banner1.jpg" alt=""> </a> </div> </a> <!-- 导航栏开始 --> <div class="nav clearfix"> <div class="w clearfix"> <ul> <li><a href="https://www.mi.com/index.html">小米商城</a></li> <li><a href="https://www.miui.com/">MiUi</a></li> <li><a href="https://iot.mi.com/">loT</a></li> <li><a href="https://i.mi.com/">云服务</a></li> <li><a href="https://airstar.com/home">天星科技</a></li> <li><a href="https://youpin.mi.com/">有品</a></li> <li><a href="https://xiaoai.mi.com/">小爱开放平台</a></li> <li><a href="https://qiye.mi.com/">企业团购</a></li> <li><a href="https://www.mi.com/aptitude/list/?id=41">资质证照</a></li> <li><a href="https://www.mi.com/aptitude/list/">协议规则</a></li> <li><a href="https://www.mi.com/appdownload/">下载app</a></li> <li><a href="https://xiaomishare.mi.com/?from=micom">智能生活</a></li> <li><a href="none.html">Select Location</a></li> </ul> <div> <ul> <li><a href="none.html">登陆</a></li> <li><a href="none.html">注册</a></li> <li><a href="none.html">通知消息</a></li> <span> <a href="https://www.mi.com/buy/cart" class="iconfont"> 购物车(0)</a> </span> </ul> </div> </div> </div>
css代码如下(部分示例):* { padding: 0; margin: 0; } li { list-style: none; } a { text-decoration: none; } em, i { font-style: normal; padding: 0; margin: 0; } @keyframes bear { 0% {} 100% { background-position: -1280px 0; } } .bear { position: fixed; top: 400px; left: 0; } /*.xiaopingzi { background-color: rgb(11, 205, 240); color: rgb(253, 78, 47); font-size: 18px; font-family: "YouYuan"; text-align: center; }*/ /* ********************* */ .xiaopingzi { background-image: -webkit-linear-gradient(left, blue, #66ffff 10%, #cc00ff 20%, #f3150d 30%, #CCCCFF 40%, #00FFFF 50%, #CCCCFF 60%, #cc0000 70%, #CC00FF 80%, #66FFFF 90%, blue 100%); -webkit-text-fill-color: transparent; /* 将字体设置成透明色 */ -webkit-background-clip: text; /* 裁剪背景图,使文字作为裁剪区域向外裁剪 */ -webkit-background-size: 200% 100%; -webkit-animation: masked-animation 4s linear infinite; font-size: 20px; text-align: center; } @keyframes masked-animation { 0% { background-position: 0 0; } 100% { background-position: -100% 0; } } /* ************************** */ .bear_box { width: 160px; height: 80px; background: url(tupian/百度浏览器奔跑的熊bear-25676f9.png) no-repeat; background-color: rgb(182, 58, 58); animation: bear 0.8s steps(8) infinite; } @font-face { font-family: 'icomoon'; src: url('fonts/icomoon.eot?bkblej'); src: url('fonts/icomoon.eot?bkblej#iefix') format('embedded-opentype'), url('fonts/icomoon.ttf?bkblej') format('truetype'), url('fonts/icomoon.woff?bkblej') format('woff'), url('fonts/icomoon.svg?bkblej#icomoon') format('svg'); font-weight: normal; font-style: normal; font-display: block; } input { outline: none; } .w { width: 1226px; margin: 0 auto; /* background-color: rgb(204, 206, 105); */ } .clearfix:after { visibility: hidden; clear: both; display: block; content: "."; height: 0; } .clearfix { *zoom: 1; }
因为代码有点多,全部上传后加载太慢,会卡死。所以想要源码的小伙伴们也请在评论区留言吧!看到后我会打包发给你的。关键词:小米,仿制