rem布局---个人首页设计

运行结果

index.html

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/index.css">
    <title>Document</title>
</head>

<body>
    <div class="banner">
        <div class="content">
            <div class="info">
                <div class="pic"></div>
                <div class="detail">
                    <h6>寻常常常</h6>
                    <p>君子不争炎凉</p>
                </div>
            </div>
            <div class="other">
                <a href="#" class="letter">私信</a href="#">
                <a href="#" class="focus">关注</a href="#">
            </div>
        </div>
    </div>

    <div class="hobby">
        <div class="song">喜欢的歌</div>
        <div class="food">喜欢的食物</div>
        <div class="novel">喜欢的小说</div>
    </div>

    <div class="ins">
        <div class="one">写代码是一件让人快乐的事情</div>
        <div class="two">
            pink老师真帅
        </div>
    </div>
</body>  

</html>

 index.less

@import 'common';

body {
    min-width: 320px;
    width: 15rem;
    margin: 0 auto;
    line-height: 1.5;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    background: linear-gradient(to bottom right,rgba(80, 153, 148, .6), rgba(148, 97, 44,.6));
}

@baseFont: 50;
.banner {
    width: 15rem;
    height: 10rem;
    background: url(../images/wy.jpg) no-repeat;
    background-size: 100% auto;
    background-position: 0 -6rem;
    position: relative;

    .content {
        position: absolute;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 12rem;
        height: 5rem;
        margin: 4rem 1.5rem 1rem;
        padding: .5rem 1rem 1rem;
        border-radius: 1rem;
        background-color: rgba(255, 255, 255, .5);
        box-sizing: border-box;

        .info {
            .pic {
            float: left;
            width: 2rem;
            height: 2rem;
            background: url(../images/tim.jpg) no-repeat;
            background-size: 2rem 2rem;
            border-radius: .2rem;
            margin-right: 0.5rem;
            }
            .detail {
                float: left;
                width: 5rem;
                height: 2rem;
                // background-color: pink;
                h
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值