第二十七章HTML.CSS综合案例(三)

5.小米侧边栏

效果如下:

代码图如下:

<style>
        *{
            margin: 0;
            padding: 0;
        }
        ul{
            list-style: none;
        }
        a{
            text-decoration: none;
        }
        .box{
            width: 100%;
            height: 100%;
            position:  absolute;
            background-image: linear-gradient(to right, #a07ad0, #c39340);
        }
        .box1{
            width: 300px;
            background-color: rgba(255,255,255,0.5);
            margin: 50px auto 0px; /* 上 左右 下 */
        }
        .box1 ul{
            padding: 20px 0px;
        }
        .box1 ul li{
            height: 42px;
            line-height: 42px;
        }
        .box1 ul li a{
            display: block;
            text-indent:2em;
            /* background-image:url('5箭头.png'); */
            /* background-repeat:no-repeat; */
            /* background-position:255px; */
        }
        .box1 ul li a:hover{
            background-color:#ff6700;
            /* display: block; */
            text-indent:2em;
            /* background-image:url('5箭头.png'); */
            /* background-repeat:no-repeat; */
            /* background-position:255px; */
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="box1">
            <ul>
                <li><a href="">手机</a></li>
                <li><a href="">电视</a></li>
                <li><a href="">笔记本 平板</a></li>
                <li><a href="">家电</a></li>
                <li><a href="">出行 穿戴</a></li>
                <li><a href="">智能路由器</a></li>
                <li><a href="">电源 配件</a></li>
                <li><a href="">健康 儿童</a></li>
                <li><a href="">耳机 音响</a></li>
                <li><a href="">生活 箱包</a></li>
            </ul>
        </div>
    </div>
</body>
</html>

5.酷狗音乐

效果图如下:

代码部分如下: 

<style>
         *{
            margin: 0;
            padding: 0;
         }
         .music {
            width: 580px;
            height: 480px;
            background-color:aqua;
            margin:50px auto 0;
         }
         a{
            text-decoration: none;
            color:#000;
         }
         .music a{
            width: 580px;
            height: 480px;
            display: block;
            position: relative,
        }
        .music p.music-number {
            height: 35px;
            width: 280px;
            position: absolute;
            top:0;
            right:0;
            background-image: linear-gradient(to left,rgba(8,0,0,0.5),rgba(255, 255,255,0));
            text-align:center;
        }
        .music p.music-number span.icon-earphone{
            width: 35px;
            height: 35px;float: right;
            background:url("images/earphone.svg")no-repeat center;
            background-size: 20px;
            margin-right: 10px;
        }
        .music p.music-numberspan.musci-number-txt {
            height: 35px;
            float: right;
            font-size: 14px;
            color: white;
            Line-height: 35px;
            padding-right: 10px;
        }
        .music .music-text{
            width: 100%;
            height: 80px;
            background-color:rgba(0,0,0,0.5);
            position: absolute;
            bottom:0;
            color: white;
        }
        .music .music-text h3{
            font-weight: 100;
            padding: 15px 0 5px 10px;
        }
        .music .music-text p{
            color: #ddd;
            padding-left: 10px;
        }
        .music .music-mask {
            background-color:rgba(0,0,0,0.5);
            position: absolute;
            left: 0;
            top:0;
            bottom:0;
            right: 0;
            display: none;
        }
        .music .play-button {
            width: 36px;
            height: 36px;
            position: absolute;
            bottom: 22px;
            right: 22px;
            background:url("images/play-button.svg");
            display: none;
        }
        .music a:hover .music-mask,
        .music a:hover .play-button{
            display: block;
        }
    </style>
</head>
<body>
    <div class="music">
        <a href="#">
            <img src="../../C4D素材文件/608e300569f0d3dab0a2a3935648283.jpg" width="580" height="480">
            <p class="music-number">
                <span class="musci-number-txt">679.9万</span>
                <span class="icon-earphone"></span>
            </p>
            <div class="music-text">
                <h3>拥有穿透力和辨识度的嗓音,勿忘心安</h3>
                <p>张杰</p>
            </div>
            <div class="music-mask">
                <div class="play-button"></div>
            </div>
        </a>
    </div>
</body>
</html>

相关推荐

  1. 第二:Docker Nginx 部署

    2024-06-12 01:00:02       15 阅读
  2. React 第二 Hook useMemo

    2024-06-12 01:00:02       12 阅读
  3. 第二

    2024-06-12 01:00:02       28 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-12 01:00:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-12 01:00:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-12 01:00:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-12 01:00:02       18 阅读

热门阅读

  1. Git如何拉取远程仓库的其他分支

    2024-06-12 01:00:02       6 阅读
  2. Spring Cloud应用框架

    2024-06-12 01:00:02       6 阅读
  3. 【python】基于pandas的EXCEL合并方法

    2024-06-12 01:00:02       11 阅读
  4. AI赋能未来:大模型与AIGC的崛起

    2024-06-12 01:00:02       6 阅读
  5. 【C++——引用&】

    2024-06-12 01:00:02       8 阅读
  6. python多线程翻译获取进度结果

    2024-06-12 01:00:02       6 阅读
  7. 力扣1818.绝对差值和

    2024-06-12 01:00:02       8 阅读
  8. 从中序与后序遍历序列构造二叉树-力扣

    2024-06-12 01:00:02       6 阅读