django学习入门系列之第三点《案例 小米商城中app图标代码》

文章目录

  • 往期回顾


/*使外边距等于0,即让边框与界面贴合*/
body{
        margin: 0;
}

/*使图片都完全展开并防止超出限制*/
img{
        height: 100%;
        width: 100%;
}

/*头标部分*/
/*控制父级边框*/
.header{
        background: #333;
      }

/*控制子级边框*/
.container{
        width: 1226px;
        margin: 0 auto;
}

/*控制子级边框下的左边菜单栏*/
.header .menu{
        float: left;
      }

/*控制子级边框下的右边菜单栏*/
.header .account{
        float: right;
        color: #b0b0b0;
}

/*控制子级边框下的菜单栏中的span标签*/
.header a{
        color: #b0b0b0;
        line-height: 40px;
        display: inline-block;
        font-size: 12px;
        margin-right: 12px;
        text-decoration: none;
}

.header a:hover{
        color: white;
}

/*控制子级边框下的菜单栏中改变光标颜色*/
.header span:hover{
        color: white;

}

.header .container .menu .place{
        position: relative;
}

.header .container .menu .size{
        position: absolute;
        height: 100px;
        width: 100px;
        top: 40px;
        display: none;
}

.header .container .menu .place:hover .size{
        display: block;
}


/*二级菜单部分*/
/*父级大框*/
.sub-header{
        height: 100px;
}

/*logo框*/
.sub-header .logo{
        width: 234px;
        height: 100px;
        float: left;
}

/*logo图片的大小设置*/
.sub-header .logo a img{
        height: 56px;
        width: 56px;
        display: inline-block;
        margin-top: 22px;
}

/*二级菜单中的小菜单边框*/
.sub-header .menu-list {
        float: left;
        line-height: 100px;
        font-size: 16px;

}

/*二级菜单中的小菜单中文字与超链接*/
.sub-header .menu-list a{
        display: inline-block;
        padding: 0 8px;
        font-family: Helvetica,sans-serif;
        color: #333;

        /*文字不想要下划线*/
        text-decoration: none;
}
/*二级菜单中的小菜单中移动光标改变颜色*/
.sub-header .menu-list a:hover{
        color: #ff6700;
}

.sub-header .search{
        float: right;
}


/*商品菜单部分*/

/*商品主图片的长宽设置*/
.slider .sd-img{
        display: block;
        width: 1226px;
        height: 460px;
        float: left;
}

/*下面第一张图片中的框架结构设置*/
.news .channel{
        margin-top: 14px;
        width: 228px;
        height: 164px;
        float: left;
        background: #5f5750;
        padding: 3px;
}
/*下面第一张图片中的小图标的框架与字体结构设置*/
.news .container .channel .item{
        width: 76px;
        height: 82px;
        float: left;
        text-align: center;
}


/*下面第一张图片中的小图标的超链接文字的颜色与字体设置*/
.news .channel .item a{
        display: inline-block;
        padding-top: 18px;
        text-decoration: none;
        color: #fff;
        opacity: 0.7;
        font-size: 12px;
        font-family: Helvetica,sans-serif;
}

/*光标移动到该位置时所对应的操作*/
.news .channel .item a:hover{
        opacity: 1;
}

/*超链接中的图片结构设置*/
.news .container .channel .item img{
        width: 24px;
        height: 24px;
        display: block;
        margin: 0 auto 4px;
}

/*其他三张图片框架的设置*/
.news .list-item{
        margin-top: 14px;
        margin-left: 14px;
        width: 316px;
        height: 170px;
        float: left;
}

DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>小米商城title>
  <link rel="stylesheet" href="/static/command.css">
head>


<body>

<div class="header">
    <div class="container">
        <div class="menu">
            <a href="https://www.mi.com/">小米官网a>
            <a href="https://www.mi.com/shop/">小米商城a>
            <a href="https://home.miui.com/">MIUIa>
            <a href="https://iot.mi.com/">loTa>
            <a href="https://i.mi.com/">云服务a>
            <a href="https://airstar.com/home">天星数科a>
            <a href="https://www.xiaomiyoupin.com/">有品a>
            <a href="https://xiaoai.mi.com/">小爱开放平台a>
            <a href="https://https://qiye.mi.com/">企业团购a>
            <a href="https://https://www.mi.com/aptitude/list/?id=88">资质证照a>
            <a href="https://www.mi.com/shop/aptitude/list">规则协议a>
            <a href="https://www.mi.com/appdownload" class="place">
                下载APP
            <div class="size">
                <img src="/static/app.png" alt="">
            div>
            a>
            <a href="https://www.mi.com/">Select Locationa>
        div>

        <div class="account">
            <a>登录a>
            <a>注册a>
            <a>消息通知a>
            <a>购物车a>
        div>
        <div style="clear: both">div>
    div>
div>


<div class="sub-header">
    <div class="container">
        <div class="logo">
            <a href="//www.mi.com" title="小米官网" class="logo ir">
                <img src="/static/logo-mi2.png" alt="">
            a>
        div>
        <div class="menu-list">
            <a href="https://www.bilibili.com/">Xiaomi手机a>
            <a href="https://www.bilibili.com/">Redmi手机a>
            <a href="https://www.bilibili.com/">电视a>
            <a href="https://www.bilibili.com/">笔记本a>
            <a href="https://www.bilibili.com/">平板a>
            <a href="https://www.bilibili.com/">家电a>
            <a href="https://www.bilibili.com/">路由器a>
            <a href="https://www.bilibili.com/">服务中心a>
            <a href="https://www.bilibili.com/">社区a>

        div>

        <div class="searcht">div>

        <div style="clear: both">div>
    div>
div>



<div class="slider">
    <div class="container">
        <div class="sd-img">
            <img src="/static/b2.jpg" alt="">
        div>
    div>
div>


<div class="news">
    <div class="container">
        <div class="channel">
            <div class="item">
                <a href="https://api.jr.mi.com/activity/scene/scenePCsearch.html?from=search/">
                    <img src="/static/d1.png" alt="">
                    <span>保障服务span>
                a>
            div>
            <div class="item">
                <a href="https://qiye.mi.com/">
                    <img src="/static/d2.png" alt="">
                    <span>企业团购span>
                a>
            div>
            <div class="item">
                <a href="https://www.mi.com/shop/order/fcode">
                    <img src="/static/d3.png" alt="">
                    <span>F码通道span>
                a>
            div>
            <div class="item">
                <a href="https://10046.mi.com/">
                    <img src="/static/d4.png" alt="">
                    <span>米粉卡span>
                a>
            div>
            <div class="item">
                <a href="https://www.mi.com/a/h/16769.html">
                    <img src="/static/d5.png" alt="">
                    <span>以旧换新span>
                a>
            div>
            <div class="item">
                <a href="https://account.xiaomi.com/fe/service/login/password?_locale=zh_CN&sid=recharge&qs=%253Fcallback%253Dhttp%25253A%25252F%25252Frecharge.10046.mi.com%25252Fsts%25253Fsign%25253DbC%2525252Bk1yrraTJbriZ0UbiV7hfzHz4%2525253D%252526followup%25253Dhttp%2525253A%2525252F%2525252Frecharge.10046.mi.com%2525252F%2526sid%253Drecharge%2526_locale%253Dzh_CN&callback=http%3A%2F%2Frecharge.10046.mi.com%2Fsts%3Fsign%3DbC%252Bk1yrraTJbriZ0UbiV7hfzHz4%253D%26followup%3Dhttp%253A%252F%252Frecharge.10046.mi.com%252F&_sign=P%2BzbqaqaY2j9zuZTC7mrhVJnmJo%3D&serviceParam=%7B%22checkSafePhone%22%3Afalse%2C%22checkSafeAddress%22%3Afalse%2C%22lsrp_score%22%3A0.0%7D&showActiveX=false&theme=&needTheme=false&bizDeviceType=">
                    <img src="/static/d6.png" alt="">
                   <span>话费充值span>
                a>
            div>
            <div style="clear: both">div>
        div>
        <div class="list-item">
            <img src="/static/a1.jpg" alt="">
        div>
        <div class="list-item">
            <img src="/static/a2.jpg" alt="">
        div>
        <div class="list-item">
            <img src="/static/a3.jpg" alt="">
        div>
        <div style="clear: both">div>
    div>
div>




body>
html>

from flask import Flask,render_template

app = Flask(__name__)

# 创建了网址 /nima和函数index的对应关系
# 以后用户在浏览器上访问/nima自动运行函数
@app.route("/nima")
def index():
    """
    return "小米商城”
    Flask内部会自动打开这个文件并读取内容,返回给用户
    默认:去当前项目目录的templates文件夹中找
    """
    return render_template("text.html")


if __name__ == '__main__':
    app.run()

往期回顾

1.【快速开发网站】
2.【浏览器能识别的标签1】
3.【浏览器能识别的标签2】
4.【浏览器能识别的标签3】
5.【浏览器能识别的标签4】
6.【案例1:用户注册】
7.【案例2:用户注册改进】
8.【快速了解 CSS】
9.【常用选择器概念讲解】
10.【CSS基础样式介绍1】
11.【CSS基础样式介绍2】
12.【CSS基础样式介绍3】
13.【CSS基础样式介绍3】
14.【案例 小米商城头标】
15.【案例 小米商城头标总结】
16.【案例 小米商城二级菜单】
17.【案例 商品推荐部分】
18.【伪类简单了解】
19.【position】

你可能感兴趣的:(django,django,学习,python,笔记,经验分享,前端框架,前端)