第二十七章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>

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值