HTML+CSS练习 酷我音乐移动端

 index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./iconfont/iconfont.css">

    <title>Document</title>
</head>
<body>
    <header>
        <div class="left"></div>
        <div class="right">
            <a href="">下载app</a>
        </div>
    </header>
    
    <a href="">
        <div class="search">
            <span class="iconfont icon-sousuo"></span>
            <div class="text">搜索你想听的歌曲</div>
        </div>
    </a>
    
    <div class="banner">
        <ul>
            <li><a href=""><img src="./assets/banner01.jpeg" alt=""></a></li>
        </ul>
    </div>

    <div class="rank">
        <div class="title">酷我排行榜</div>
        <a href="">
            <div class="more">更多<span class="iconfont icon-right"></span></div>
        </a>
    </div>
    
    <div class="content">
        <ul>
            <li>
                <div class="pic"><img src="./assets/icon_rank_hot.png" alt=""></div>
                <div class="text">
                    <a href="">
                        <div class="first">
                            酷我热歌榜<span class="iconfont icon-right"></span>
                        </div>
                    </a>
                    <a href="">1.悬溺 - 葛东琪</a>
                    <a href="">2.可能 - 程响</a>
                    <a href="">2.可能 - 程响</a>
                </div>
            </li>
            <li>
                <div class="pic"><img src="./assets/icon_rank_hot.png" alt=""></div>
                <div class="text">
                    <a href="">
                        <div class="first">
                            酷我热歌榜<span class="iconfont icon-right"></span>
                        </div>
                    </a>
                    <a href="">1.悬溺 - 葛东琪</a>
                    <a href="">2.可能 - 程响</a>
                    <a href="">2.可能 - 程响</a>
                </div>
            </li>
            <li>
                <div class="pic"><img src="./assets/icon_rank_hot.png" alt=""></div>
                <div class="text">
                    <a href="">
                        <div class="first">
                            酷我热歌榜<span class="iconfont icon-right"></span>
                        </div>
                    </a>
                    <a href="">1.悬溺 - 葛东琪</a>
                    <a href="">2.可能 - 程响</a>
                    <a href="">2.可能 - 程响</a>
                </div>
            </li>
        </ul>
    </div>


    <div class="rank">
        <div class="title">推荐歌单</div>
        <a href="">
            <div class="more">更多<span class="iconfont icon-right"></span></div>
        </a>
    </div>

    <div class="content-2">
        <ul>
            <li>
                <div class="pic">
                    <img src="" alt="">
                    <div class="cover">3621.3w</div>
                </div>
                <div class="text">经典老歌大放送!一人一首代表作!</div>
            </li>
            <li>
                <div class="pic">
                    <img src="" alt="">
                    <div class="cover">3621.3w</div>
                </div>
                <div class="text">经典老歌大放送!一人一首代表作!</div>
            </li>
            <li>
                <div class="pic">
                    <img src="" alt="">
                    <div class="cover">3621.3w</div>
                </div>
                <div class="text">经典老歌大放送!一人一首代表作!</div>
            </li>
            <li>
                <div class="pic">
                    <img src="" alt="">
                    <div class="cover">3621.3w</div>
                </div>
                <div class="text">经典老歌大放送!一人一首代表作!</div>
            </li>
            <li>
                <div class="pic">
                    <img src="" alt="">
                    <div class="cover">3621.3w</div>
                </div>
                <div class="text">经典老歌大放送!一人一首代表作!</div>
            </li>
            <li>
                <div class="pic">
                    <img src="" alt="">
                    <div class="cover">3621.3w</div>
                </div>
                <div class="text">经典老歌大放送!一人一首代表作!</div>
            </li>
        </ul>
        
    </div>


    <div class="download">
        <div class="inside">
            <div class="pic"><img src="./assets/logo.png" alt=""></div>
            <p>安装酷我音乐 发现更多好音乐</p>
            <span class="iconfont icon-right"></span>
        </div>
    </div>
</body>
</html>

index.less 

// out: ../css/

@import "./base.less";

@fs: 3.75vw;

body{
    background-color: #f9fafb;
}

header{
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: (50 / @fs);
    padding: 0 (15 / @fs);
    background-color: #fff;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    .left{
        width: (235 / @fs);
        height: (50 / @fs);
        background-color: aqua;
        background: url(../assets/head.png);
        background-size: contain;
        background-repeat: no-repeat;
    }
    .right{
            width: (80 / @fs);
            height: (30 / @fs);
        a{
            display: block;
            width: (80 / @fs);
            height: (30 / @fs);
            background-color: #ffe31b;
            border-radius: (15 / @fs);
            text-align: center;
            line-height:(30 / @fs);
        }
    }
}

.search{ 
    margin: (10 / @fs);
    margin-top: (65 / @fs);

    height: (30 / @fs);
    background-color: #f2f4f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f2f4f5;
    border-radius:(32 / @fs);
    .icon-sousuo{
        width: (17 / @fs);
        height: (17 / @fs);
        font-size: (17 / @fs);
        color: #a1a4b3;
        position: absolute;
        left: 28%;
    
    }
    .text{
    width: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: (30 / @fs);
    font-size: (15 / @fs);
    text-align: center;
    line-height:  (15 / @fs);
    color: #a1a4b3;
    }
}


.banner{
    margin:(10 / @fs) 0  ;
    padding: 0 (10 / @fs);
    height: (102 / @fs);
    ul{
        li{
            height: (102 / @fs);
            img{
                border-radius: (5 / @fs);
                width: 100%;
                height:  100%;
                object-fit: cover;
            }
        }
    }
}

.rank{
    height: (28 / @fs);
    // background-color: red;
    margin-bottom: (13 / @fs);
    padding: 0 (13 / @fs);
    display: flex;
    justify-content: space-between;
    .title{
        font-size: (20 / @fs);
        font-weight: 700;
        color: #262338;
    }
    .more{
        color: #a1a4b3;
        line-height: (28 / @fs);
    }
}

.content{
    ul{
        li{
            height:(105 / @fs);
            background-color: #fff;
            margin: (13 / @fs) ;
            border-radius: (10 / @fs);
            display: flex;
            
            .pic{
                margin-right: (15 / @fs);
                img{
                    width: (105 / @fs);
                    height:(105 / @fs);
                    border-radius: (10 / @fs);
                }
            }
            .text{
                
                a{
                    .first{
                        
                        display: block;
                        font-size:  (18 / @fs) ;
                        color: #262338;
                        // background-color: red;
                        
                        padding-top: (5 / @fs);
                    }
                    display: block;
                    color: #a1a4b3;
                    margin: (4 / @fs) 0;
                    font-size:  (12 / @fs) ;
                    // background-color: aqua;
                }
            }
        }
    }
}



.content-2{
    
    margin-left:  (8 / @fs) ;
    // background-color: pink;
    margin: (13 / @fs) ;
    ul{
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        li{
                
        width:(105 / @fs) ;
        height:(154 / @fs) ;
        // background-color: red;
        border-radius: (10 / @fs);
        margin-bottom: (18 / @fs) ;
            .pic{
                width:(105 / @fs) ;
                height:(105 / @fs) ;
                // background-color: aqua;
                border-radius: (10 / @fs);

                
                position: relative;
                img{
                    background: url(../assets/song01.jpeg);
                    background-size: contain;
                    background-repeat: no-repeat;
                    width: 100%;
                    height:  100%;
                    object-fit: cover;
                    border-radius: (10 / @fs);
                }
                
                .cover{
                    position: absolute;
                    left: 0;
                    bottom: 0;
                    width:(58 / @fs) ;
                    height:(28 / @fs) ;
                    background-color: rgba(0, 0, 0, .3);
                    border-radius: 0 (10 / @fs) 0 (10 / @fs);
                    font-size: (12 / @fs) ;
                    color: #fff;
                    line-height:(28 / @fs) ;
                    text-align: center;
                }
            }
        
            .text{
                margin-top: (7 / @fs);
                color: #262338;
                font-size: (13 / @fs);
                font-weight: 400;
                line-height: (13 / @fs);
            }
        }
    }
}

.download{
    position: fixed;
    left: 0;
    bottom: (28 / @fs);
    height: (45 / @fs);
    width:  (375 / @fs);
    // background-color: #a02f2f;
    .inside{
        width: (311 / @fs);
        height: (45 / @fs);
        background-color: #fff;
        margin: 0 (28 / @fs);
        border-radius: (20 / @fs);
        display: flex;
        justify-content: space-between;
        align-items: center;
        .pic{
            height: (37 / @fs);
            width:  (37 / @fs);
            margin: (20 / @fs);;
            margin-right: (10 / @fs);
            // background-color: #531616;
            img{
                height: (37 / @fs);
                width: (37 / @fs);
            }
        }
    
        p{
            font-weight: 700;
            color: #333;
            flex: 1;
            font-size: (15 / @fs);;
        }
        .iconfont{
            height: (27 / @fs);
            width:  (27 / @fs);
            color: #333;
            background-color: rgba(0, 0, 0, .05);
            border-radius: 50%;
            font-size:  (20 / @fs);
            font-weight: 700;
            line-height: (27 / @fs);
            text-align: center;
            margin-right: (10 / @fs);
        }
    }
}

base.less

// out: false
*,
::after,
::before {
  box-sizing: border-box;
}

body,
ul,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 0;
  margin: 0;
}

body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    PingFangSC-Regular,
    "PingFang SC",
    "Microsoft YaHei",
    "Helvetica Neue",
    Helvetica,
    Arial,
    sans-serif;
  font-size: 14px;
  color: #333;
}

img {
  vertical-align: bottom;
}

ul {
  list-style-type: none;
}

a {
  color: #333;
  text-decoration: none;
  -webkit-tap-highlight-color: rgb(0 0 0 / 0%);
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值