【小米商城】页面编写笔记(自用)

news2025/6/27 0:41:00

页面展示:

代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        body{
            margin: 0;
        }
        img{
            width:100%;
            height: 100%;
        }

        .header{
            /*height: 38px;*/
            color: #b0b0b0;
            background: #333;
        }
        .header .container{
            width: 1128px;
            margin: 0 auto;
        }
        .header .menu{
            float: left;
            color: white;
            /*height: 38px;*/
            /*line-height: 38px;*/
        }
        .header .acount{
            float: right;
            color: white;
            /*height: 38px;*/
            /*line-height: 38px;*/
        }
        .header  a{
            color: #b0b0b0;
            line-height: 40px;
            display: inline-block;
            font-size: 12px;
            margin-right: 5px;
        }

        .second{
            color: #333;
            background-color: #fff;
            min-width: 1226px;
        }
        .second .container{
            width: 1128px;
            margin: 0 auto;
        }
        .second .logo{
            float: left;
            width: 200px;
            height: 100px;
            margin-top: 22px;
        }
        .second .menu{
            float: left;
            width: 700px;
            height: 100px;
            line-height: 100px;
            font-size: 16px;

        }
        .second .acount{
            float: right;
            width: 150px;
            height: 100px;
            margin-top: 22px;
        }
        .second a{
            display: inline-block;
            padding: 0 10px;
            color: #333;
            text-decoration: none;
        }
        .second a:hover{
             color: chocolate;
         }

        .silder{

        }
        .silder .container{
            width: 1226px;
            height: 460px;
            margin: 0 auto;
        }

        .news{
            margin-top: 14px;
        }
        .news .container{
            width: 1226px;
            margin: 0 auto;
            margin-top: 14px;
        }
        .news .chan{
            float: left;
            width: 244px;
            height: 170px;
            background: #5f5750;
        }
        .news .list-item{
            float: left;
            width: 316px;
            height: 170px;
            margin-left: 10px;
        }
        .news .chan .item{
            height: 82px;
            width: 76px;
            float: left;
            padding: 2px;
            margin-bottom: 3px;
            display: block;
        }
        .news a{
            text-decoration: none;
            color: rgba(255, 255, 255, 0.7);
        }
        .news a:hover{
                        color: rgba(255, 255, 255, 1);
        }
    </style>
</head>
<body>

    <div class="header">
        <div class="container">
        <div class="menu">
            <a >小米商城</a>
            <a >MIUI</a>
            <a >loT</a>
            <a >云服务</a>
            <a >天星数科</a>
            <a >有品</a>
            <a >小爱开放平台</a>
            <a >企业团购</a>
            <a >资质证照</a>
            <a >协议规则</a>
            <a >下载app</a>
            <a >智能生活</a>
        </div>
        <div class="acount">
            <a>登录</a>
            <a>注册</a>
            <a>消息通知</a>
            <a>购物车</a>
        </div>
        <div style="clear: both"></div>
        </div>
    </div>

    <div class="second">
        <div class="container">
            <div class="logo">
                <a href="https://www.mi.com/index.html" title="小米官网" style="display: inline-block">
                    <img src="/static/小米图标.png" style="height: 56px " alt="">
                </a>
            </div>
            <div class="menu">
                <a href="https://www.mi.com/index.html">Xiaomi手机</a>
                <a href="https://www.mi.com/index.html">Remi手机</a>
                <a href="https://www.mi.com/index.html">电视</a>
                <a href="https://www.mi.com/index.html">笔记本</a>
                <a href="https://www.mi.com/index.html">平板</a>
                <a>家电</a>
                <a>路由器</a>
                <a>服务中心</a>
                <a>社区</a>
            </div>
            <div class="acount">
                <a>搜索</a>
            </div>
            <div style="clear: both"></div>
        </div>
    </div>

    <div class="silder">
        <div class="container">
            <img src="/static/中间图片.png ">
        </div>
    </div>

    <div class="news">
        <div class="container">
            <div class="chan">
                <div class="item">
                    <a href="https://www.mi.com/index.html">
                        <img src="/static/图标.png" style="width: 30px;height: 24px;margin-left: 15px;margin-right: 12px;margin-top: 14px">
                        <span>小米秒杀</span>
                    </a>
                </div>
                <div class="item">
                     <a href="https://www.mi.com/index.html">
                        <img src="/static/图标.png" style="width: 30px;height: 24px;margin-left: 15px;margin-right: 12px;margin-top: 14px">
                        <span>企业团购</span>

                    </a>
                </div>
                <div class="item">
                     <a href="https://www.mi.com/index.html">
                        <img src="/static/图标.png" style="width: 30px;height: 24px;margin-left: 18px;margin-right: 15px;margin-top: 14px">
                        <span>F码通道</span>

                    </a>
                </div>
                <div class="item">
                     <a href="https://www.mi.com/index.html">
                        <img src="/static/图标.png" style="width: 30px;height: 24px;margin-left: 15px;margin-right: 12px;margin-top: 14px">
                        <span>米粉卡</span>
                    </a>
                </div>
                <div class="item">
                     <a href="https://www.mi.com/index.html">
                        <img src="/static/图标.png" style="width: 30px;height: 24px;margin-left: 15px;margin-right: 12px;margin-top: 14px">
                        <span>以旧换新</span>
                    </a>
                </div>
                <div class="item">
                     <a href="https://www.mi.com/index.html">
                        <img src="/static/图标.png" style="width: 30px;height: 24px;margin-left: 15px;margin-right: 12px;margin-top: 14px">
                        <span>花费充值</span>
                    </a>
                </div>
                <div class="clear: both"></div>
            </div>
            <div class="list-item">
                <img src="/static/1.png">
            </div>
            <div class="list-item">
                <img src="/static/2.png">
            </div>
            <div class="list-item">
                <img src="/static/3.png">
            </div>
            <div class="clear: both"></div>
        </div>

    </div>
</body>
</html>

知识点总结:

  • body标签,默认会有一个边距,造成页面的四边都有白色的间隙,如何去除?
body{
    margin: 0;
}

不加之前:

去掉间隙后:

  • 内容居中

文本居中【文本在这个区域居中】

.c2{
    background-color: pink;
    width: 300px;
    height: 300px;
}
<div class="c2">
<div style="width: 100px;text-align: center">SHH</div>
</div>

区域居中【自己要有宽度+margin-left:auto ;margin-right:auto】

  • 父亲没有高度或者没有宽度,被孩子支撑起来
  • 如果存在float,一定要加:
<div style="clear: both"></div>
  • a标签是行内标签,行内标签的高度、内外边距,默认无效。要用
display: inline-block;
  • 垂直方向居中

文本+line-height

图片+边距

  • a标签默认有下划线,去掉:
text-decoration: none;

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1822726.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Linux开机自启/etc/init.d和/etc/rc.d/rc.local

文章目录 /etc/init.d和/etc/rc.d/rc.local的区别/etc/init.dsystemd介绍 /etc/init.d和/etc/rc.d/rc.local的区别 目的不同&#xff1a; /etc/rc.d/rc.local&#xff1a;用于在系统启动后执行用户自定义命令&#xff0c;适合简单的启动任务。 /etc/init.d&#xff1a;用于管理…

Vulnhub-DC-5

靶机IP:192.168.20.139 kaliIP:192.168.20.128 网络有问题的可以看下搭建Vulnhub靶机网络问题(获取不到IP) 信息收集 nmap扫下端口及版本 dirsearch扫下目录 LinuxphpNginx 环境 我们再去看前端界面&#xff0c;发现在contact界面有能提交的地方&#xff0c;但是经过测试不…

开源项目QAnything:全能型本地知识库问答系统

在当今信息爆炸的时代&#xff0c;如何高效地管理和检索大量数据成为了一个重要课题。网易有道推出的开源项目QAnything&#xff0c;正是为了解决这一问题而生。QAnything是一个本地知识库问答系统&#xff0c;支持多种文件格式和数据库&#xff0c;允许用户在离线状态下进行安…

“探索机器学习的多面世界:从理论到应用与未来展望“

博客主页&#xff1a;誓则盟约系列专栏&#xff1a;机器学习 专栏关注博主&#xff0c;后期持续更新系列文章如果有错误感谢请大家批评指出&#xff0c;及时修改感谢大家点赞&#x1f44d;收藏⭐评论✍ 目录 一、机器学习基础理论 1.机器学习的定义与分类 监督学习 无监督学…

[c++刷题]贪心算法.N01

题目如上: 首先通过经验分析&#xff0c;要用最少的减半次数&#xff0c;使得数组总和减少至一半以上&#xff0c;那么第一反应就是每次都挑数组中最大的数据去减半&#xff0c;这样可以是每次数组总和值减少程度最大化。 代码思路:利用大根堆去找数据中的最大值&#xff0c;…

MPLS提高网络服务质量的原理

MPLS&#xff08;Multiprotocol Label Switching&#xff0c;多协议标签交换&#xff09;是一种网络技术&#xff0c;它能够提高网络的服务质量&#xff08;Quality of Service&#xff0c;QoS&#xff09;以及整体性能。MPLS通过以下几种方式来提升网络服务质量&#xff1a;标…

CorelDRAW2024破解版下载 设计界的神器,你值得拥有!

数字艺术家们&#xff0c;你们有没有遇到过这样的困扰&#xff1a;想要创作出令人惊叹的数字艺术作品&#xff0c;但却受限于工具的选择&#xff1f;&#x1f914; 好消息来了&#xff01;CorelDRAW2024这款强大的设计软件终于问世了&#xff01;&#x1f389; 作为一名热衷于探…

Python基础教程(十一):数据结构汇总梳理

&#x1f49d;&#x1f49d;&#x1f49d;首先&#xff0c;欢迎各位来到我的博客&#xff0c;很高兴能够在这里和您见面&#xff01;希望您在这里不仅可以有所收获&#xff0c;同时也能感受到一份轻松欢乐的氛围&#xff0c;祝你生活愉快&#xff01; &#x1f49d;&#x1f49…

信号与系统实验MATLAB-实验2-连续时间系统的时域分析

实验二 连续时间系统的时域分析 一、实验目的 1、掌握连续时间信号卷积及其MATLAB实现方法&#xff1b; 2、掌握连续系统的冲激响应、阶跃响应及其MATLAB实现方法&#xff1b; 3、掌握利用MATLAB求LTI系统响应的方法&#xff1b; 4、掌握利用MATLAB求函数卷积和解微分方程…

【递归、搜索与回溯】综合练习一

综合练习一 1.找出所有子集的异或总和再求和2.全排列 II3.电话号码的字母组合4.括号生成 点赞&#x1f44d;&#x1f44d;收藏&#x1f31f;&#x1f31f;关注&#x1f496;&#x1f496; 你的支持是对我最大的鼓励&#xff0c;我们一起努力吧!&#x1f603;&#x1f603; 1.找…

Django序列化器详解:普通序列化器与模型序列化器的选择与运用

系列文章目录 Django入门全攻略&#xff1a;从零搭建你的第一个Web项目Django ORM入门指南&#xff1a;从概念到实践&#xff0c;掌握模型创建、迁移与视图操作Django ORM实战&#xff1a;模型字段与元选项配置&#xff0c;以及链式过滤与QF查询详解Django ORM深度游&#xff…

Go Gin框架

一、Gin介绍 Gin是一个用Go编写的HTTPweb框架。它是一个类似于martini但拥有更好性能的API框架, 优于httprouter&#xff0c;速度提高了近 40 倍。点击此处访问Gin官方中文文档。 二、安装 1、安装Gin go get -u github.com/gin-gonic/gin 2、代码中引入 import "githu…

Aptos Builder Jam 亚洲首站|议程公布,无限畅想 Aptos 生态未来

作为一个新兴的 Layer1 公链&#xff0c;Aptos 自诞生之日起的理想便是 “A Layer 1 for everyone” 当 Web3 深陷熊市阴影之时&#xff0c;Aptos 奋力为开发者找到了全新的技术路径&#xff0c;正有 200 项目正在开发&#xff0c;并且已有大量 DeFi 项目落实部署工作&#xff…

席卷的B站《植物大战僵尸杂交版》V2.0.88整合包,PC和手机可用,含通关存档和视频教程!

今天给大家安利一款席卷B站&#xff0c;火爆全网的游戏——《植物大战僵尸杂交版》2.0.88整合包。 这个是网络上现存植物大战僵尸杂交版的最全整合&#xff0c;包含了修改工具&#xff0c;超强通关存档和高清工具。工具包有安装视频教程&#xff0c;支持手机版和pc多端使用&am…

工业烤箱设备厂家:专业制造,助力工业发展

随着现代工业的不断发展&#xff0c;工业烤箱设备在各个领域的应用越来越广泛。作为专业的工业烤箱设备厂家&#xff0c;我们致力于为客户提供高质量、高效率的烤箱设备&#xff0c;助力工业生产的顺利进行。 工业烤箱设备在工业生产中扮演着至关重要的角色。无论是电子、化工、…

数据结构重要知识总结

数组 数组&#xff08;Array&#xff09; 是一种很常见的数据结构。它由相同类型的元素&#xff08;element&#xff09;组成&#xff0c;并且是使用一块连续的内存来存储。 我们直接可以利用元素的索引&#xff08;index&#xff09;可以计算出该元素对应的存储地址。 数组…

DP:两个数组的dp问题

解决两个数组的dp问题的常用状态表示&#xff1a; 1、选取第一个字符串[0-i]区间以及第二个字符串[0,j]区间作为研究对象 2、根据题目的要求确定状态表示 字符串dp的常见技巧 1、空串是有研究意义的&#xff0c;引入空串可以帮助我们思考虚拟的边界如何进行初始化。 2、如…

Python数据分析与机器学习在医疗诊断中的应用

文章目录 &#x1f4d1;引言一、数据收集与预处理1.1 数据收集1.2 数据预处理 二、特征选择与构建2.1 特征选择2.2 特征构建 三、模型选择与训练3.1 逻辑回归3.2 随机森林3.3 深度学习 四、模型评估与调优4.1 交叉验证4.2 超参数调优 五、模型部署与应用5.1 模型保存与加载5.2 …

深入解析Prometheus:强大的开源监控与告警系统

目录 引言 一、运维监控平台的设计思路 &#xff08;一&#xff09;设计思路 1.数据收集模块 2.数据提取模块 3.监控告警模块 &#xff08;二&#xff09;监控平台层级 二、Prometheus简介 &#xff08;一&#xff09;基本介绍 &#xff08;二&#xff09;核心特征 …

二叉树左右树交换

leetcode 226题 翻转二叉树 题目描述 给你一棵二叉树的根节点 root &#xff0c;翻转这棵二叉树&#xff0c;并返回其根节点。 示例 1&#xff1a; 输入&#xff1a;root [4,2,7,1,3,6,9] 输出&#xff1a;[4,7,2,9,6,3,1]示例 2&#xff1a; 输入&#xff1a;root [2,1,3]…