首页 > 其他分享 >网页布局------小米商城官网

网页布局------小米商城官网

时间:2024-05-18 12:40:45浏览次数:22  
标签:font 网页 icon height content header ------ 官网 before

小米商城官网地址小米商城 - Xiaomi 14 Ultra、Redmi K70、MIX FOLD 3,小米电视官方网站

一、头部

1、效果图

2、网页结构

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小米官网</title>
    <link rel="stylesheet"  href="./header.css" >
    <link rel="stylesheet" href="./iconfont.css">
    <link rel="stylesheet" href="./mi.css">
    <link rel="stylesheet" href="./reset.css">
    <link rel="icon" href="./images/favicon.ico" >
</head>
<body>
    <div class="header">
        <div class="content">
            <div class="header-left">
                <ul class="header-left-ul">
                    <li><a href="#">小米商城</a><span>|</span></li>
                    <li><a href="#">MIUI</a><span>|</span></li>
                    <li><a href="#">loT</a><span>|</span></li>
                    <li><a href="#">云服务</a><span>|</span></li>
                    <li><a href="#">星天数科</a><span>|</span></li>
                    <li><a href="#">有品</a><span>|</span></li>
                    <li><a href="#">小爱开放平台</a><span>|</span></li>
                    <li><a href="#">企业团购</a><span>|</span></li>
                    <li><a href="#">资质证照</a><span>|</span></li>
                    <li><a href="#">协议规则</a><span>|</span></li>
                    <li class="header-download"><a href="#">
                        下载app</a><span>|</span>
                        <div class="header-download-div">
                            <img  src="./images/78c30d4f259ed43ab20e810a522a6249.png" />
                            <span>小米商城APP</span>
                        </div>
                    
                    </li>
                    <li><a href="#">智能生活</a><span>|</span></li>
                    <li><a href="#">Select Location</a><span>|</span></li>
                </ul>
            </div>
            <div class="header-right">
                <ul class="header-right-ul">
                    <li><a href="#">登录</a><span>|</span></li>
                    <li><a href="#">注册</a><span>|</span></li>
                    <li><a href="#">消息通知</a><span>|</span></li><span>|</span>
                    <li class="shop-li">
                        <a href="#">
                            <i class="iconfont">&#xe653;</i>购物车(0)
                            <div class="shop-div">
                                <span>购物车中还没有商品,赶紧选购吧!</span>
                            </div>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</body>
</html>

 

3、css样式

/* 头部 */
*{
    margin: 0;
    padding: 0;
}
/* 头部设置 */
.header{
    width: 100%;
    height: 40px;
    background-color: #333;

}
.content{
    width: 1226px;
    height: 40px;
    margin: 0 auto;
    text-align: center;
    line-height: 40px;
}
li{
    list-style-type: none;
}
.content a{
    text-decoration: none;
    color: #b0b0b0;
    font-size: 12px;
}
.content a:hover{
    color: white;
}
.header-left{
    float: left;
}
.header-right{
    float: right;
}
.header-left-ul>li{
    float: left;
}
.header-right-ul>li{
    float: left;
}
.content li span{
    color: #424242;
    margin: 0 6px;
}
.shop-li{
    background-color: #424242;
    margin-left: 25px;
    width: 120px;
    height: 40px;
    position: relative;
}
.shop-li i{
    margin-right: 4px;
}
.shop-li:hover{
    background-color: white;
    cursor: pointer;
}
.shop-li:hover>a>font{
    color: coral;
}
/* 头部下拉设置 */

.header-download{
    position: relative;

}
.header-download-div{
    position: absolute;
    top: 40px;
    left: 50%;
    margin-left: -62px;
    width: 124px;
    height: 0;
    overflow: hidden;
    background-color: white;
    box-shadow: 0px 1px  5px #aaa;
    transition: all .3s;
}
.header-download-div img{
    width: 90px;
    height: 90px;
    margin: 18px auto 12px;
    display: block;

}
.header-download-div span{
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    display: block;
    padding-bottom: 10px;
}
.header-download:hover >.header-download-div{
    height: 150px;
}
/* 购物车显示 */
.shop-div{
    position: absolute;
    right: 0px;
    top:40px;
    width: 316px;
    height: 0;
    background-color: white;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, .15);
    text-align: center;
    line-height: 80px;
    overflow: hidden;
    transition: all .3s;
}
.shop-li:hover >a> .shop-div{
    height: 80px;
}

 

4、问题

1、悬浮到购物车文字上时,文字自动变为白色,在页面中查看源代码多出了font需要设置在a后面

2、左右两边都有数据时,需要设置两个div包裹起来使用float定位分别设置left和right,里面的数据在设置为float:left浮动,如果不设置两个div直接对数据设置左右浮动那么右侧数据将会反过来

3、购物车图片是引入进来的代码如下,通过class设置iconfont来引用

@font-face {font-family: "iconfont";
  src: url('iconfont.eot?t=1548064192113'); /* IE9 */
  src: url('iconfont.eot?t=1548064192113#iefix') format('embedded-opentype'), /* IE6-IE8 */
  url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAA+gAAsAAAAAG3AAAA9QAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCFfgqkbJ1pATYCJANcCzAABCAFhG0HgjIb8xYz0lHSygnZ/yGBGzKhPtSXQUK0JdFIprZadjSVfSM10vjmWFwKGx5fLFiwy1dQ6Ofu322244ZjhlJeT3P+vnsXu4vcxQmaVNBSJFSCBUhCNWJQ0WlSpSZQCRVTpBpqaul36v4hCG/3+xVwogs4wTgKLcKEA31JYAHQ5ucD/zd1VsAHvt3DVKL1acf1Q7ItO4lSRyoNvdvrBWm7u1CNwHgVxWYikZrI3e9l8wjSepyqAG8ukUkNEEQ8AziY3P/fWmqBi3uvwoRKLExelaxRM4fzd//27YQnxBOeCxZRMQhZy3sbgk2KpIBV6sjWmRqpC6lrHMSvYV23RFSD4daOWcEsLJw8z7qtewMEgBIlCTo+3pAAH4nqCF1uXLUE8LlspMSD8DdwBaN2hOZa8Nu0dhnAHPbn0Q978AEInAR6X/brxeXAWNwyFpj4zJke9wQATOwAMIAkAOTELKH1J2Cg1TyM2rjbDaIw5PHFxaUSTSdRrrZcivnVxJRexi+LVaTGy9ZmHUV7SgUSZcTqUhtKkJSY7CX/mYeJiCmRKDQ5IT4FFg8HQYBLRoIhBWgF0lkIANCGJiWo5e6XAQRqFcsABrVKDiKgChzEwGjoANSBAwmMBwcKmAAONDARHOTAbHAQAnPAgQ/MBQcFsA04sMC24MADusCBAywCBwJYDA4CoB86xAdrsAzIwFOGg4RhOnQwYwYKQYoaquMoyQA6AM4HeC+Ym5kk8REkHsciLyTCw148XAQ1bzyQqH5jIcUh6RARIkYoIE1DgTBCygi1O0jYyAh1mFTNikYDI0lD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+i5hYEoxpsboSUWnSla43WeywzL7AvGZh/xehXhYEEV9lj5RsvMf4JrVUGo9aHOYy9D582ukLWrohver0ZY9xCIvL5kejAQAAAA==') format('woff2'),
  url('iconfont.woff?t=1548064192113') format('woff'),
  url('iconfont.ttf?t=1548064192113') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
  url('iconfont.svg?t=1548064192113#iconfont') format('svg'); /* iOS 4.1- */
}

.iconfont {
  font-family: "iconfont" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon-15tianwuliyoutuihuo:before {
  content: "\e606";
}

.icon-liwu:before {
  content: "\e657";
}

.icon-iconfonticon5:before {
  content: "\e615";
}

.icon-shouji01:before {
  content: "\e622";
}

.icon-gouwuche:before {
  content: "\e653";
}

.icon-icon:before {
  content: "\e666";
}

.icon-zhizhen:before {
  content: "\e64d";
}

.icon-jiantou2:before {
  content: "\e63e";
}

.icon-youjiantou:before {
  content: "\e658";
}

.icon-buoumaotubiao46:before {
  content: "\e629";
}

.icon-jiantouyou:before {
  content: "\e62a";
}

.icon-fangdajing:before {
  content: "\e63d";
}

.icon-jiantou:before {
  content: "\e616";
}

.icon-jiantou_zuo:before {
  content: "\e617";
}

.icon-duihua:before {
  content: "\e710";
}

.icon-dianhuaqia:before {
  content: "\e733";
}

.icon-chongzhijilu:before {
  content: "\e64c";
}

.icon-gouwuche1:before {
  content: "\e735";
}

.icon-kefu:before {
  content: "\e6ab";
}

.icon-liwu1:before {
  content: "\e62b";
}

.icon-qitianwuliyoutuihuan:before {
  content: "\e63f";
}

.icon-F:before {
  content: "\e61f";
}

 

二、

标签:font,网页,icon,height,content,header,------,官网,before
From: https://www.cnblogs.com/lixianhui/p/18175600

相关文章

  • 任务异常自动告警
    任务异常自动告警虽然可以通过界面来监控了,但是我们想要得更多,人不可能天天盯着界面看吧,如果能实现任务执行失败就自动发邮件告警就好了。这个Celery当然也是没有问题的。通过钩子程序在异常的时候触发邮件通知使用示例fromceleryimportshared_taskimporttimefromcele......
  • python计算机视觉学习笔记——PIL库的用法
    如果需要处理的原图及代码,请移步小编的GitHub地址传送门:请点击我如果点击有误:https://github.com/LeBron-Jian/ComputerVisionPractice这个是之前的笔记,自己看到了就顺带发出来,也是温习一下,内容可能不太全,算是入门贴吧。前言:PIL 图像处理是计算机视觉领域中......
  • 4、单行函数
    最近项目要用到Oracle,奈何之前没有使用过,所以在B站上面找了一个学习视频,用于记录学习过程以及自己的思考。视频链接:【尚硅谷】Oracle数据库全套教程,oracle从安装到实战应用如果有侵权,请联系删除,谢谢。本文主要讲解以下几点:SQL中不同类型的函数在SELECT语句中使用字......
  • Narrative writing revision
    Frozen​Elsa'sperspective​I'mElsa,aprincess,andIhaveasisternamedAnna.Ihavethemagictocontroltheiceandsnow.MysisterandIalwaysplaywithitsecretly.However,duringaplaywithmysister,Iaccidentallyhurtherwithmagic......
  • CF-945(已更A,B)
    CF-945(A,B)A分析模拟合法情况下三个数的和只能是偶数:题中的两种操作显然都不会改变和的奇偶性这点我的代码中没有用到要使平局数最多,一定是最大的两个数减一,重复这个过程,直到两个较小的数都为零,且最大数一定是偶数,否则不合法:可以由题意和样例想到代码inta[4];voidso......
  • “很多事情都比你想象的好一点”
    其实这个世界更多的还是温情。其实当你处于一段关系的连接之中,就必然面临着会失去很多坦诚,多了很多顾虑。但是我真的说不出来那些冰冷无感的文字,因为我并不是那样的人。所以我总是小心翼翼的组织我的语言,祈求不要伤到对方;我总是缺乏底线的答应一些事,即使它会让我很难堪。但......
  • python中的装饰器,迭代器,生成器之间的关系
    一、装饰器装饰即修饰,意指为其他函数添加新功能;装饰器的本质就是函数作用是为其他函数添加新功能,如计算该函数运行时长装饰器遵循原则:1.不修改被装饰函数的源代码(开放封闭原则)2.为被装饰函数添加新功能后,不能修改被修饰函数的调用方式装饰器的实现=高阶函数+函数嵌套+......
  • Angular-测试驱动开发-全-
    Angular测试驱动开发(全)原文:zh.annas-archive.org/md5/60F96C36D64CD0F22F8885CC69A834D2译者:飞龙协议:CCBY-NC-SA4.0前言本书将为读者提供一个关于JavaScript测试驱动开发(TDD)的完整指南,然后深入探讨Angular的方法。它将提供清晰的、逐步的示例,不断强调TDD的最佳实......
  • Windows Security Baselines(安全基线指南) 是由微软提供的一个安全配置集合,旨在帮助组
    安全基线指南-WindowsSecurity|MicrosoftLearnWindowsSecurityBaselines(安全基线)是由微软提供的一个安全配置集合,旨在帮助组织和管理员快速部署一套推荐的安全设置,以增强Windows操作系统及其组件的安全性。这些基线覆盖了操作系统本身、MicrosoftEdge浏览器、Inter......
  • RepVGG-GELAN | 融合 VGG、ShuffleNet 与 YOLO 图像检测的准确性及效率再上一层!
    前言 基于YOLO的目标检测算法在速度和准确性之间取得了显著的平衡。然而,它们在脑肿瘤检测中的应用仍然未被充分探索。本研究提出了RepVGG-GELAN,这是一种新型的YOLO架构,通过集成RepVGG,一种重新参数化的卷积方法,特别关注于医学图像中的脑肿瘤检测。RepVGG-GELAN利用RepVGG架构来提......