文字在div居中,底部是1,2

在这里插入图片描述
源码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .cab {
            float: left;
            width: 48%;
            height: 150px;
            border-radius: 5px;
            margin: 2.5px;
        }

        .Upgrade {
            /* display: flex;
            align-items: center; */
            font-size: 16px;
            font-weight: 600;
            background: blue  no-repeat left top;
            background-size: 100% 150px;
        }
        .describe {
            width: 100%;
            text-align: center;
            margin-top: 20px;
        }

        .first {
            font-size: 15px;
            font-weight: 600;
            color: #fff;
        }

        .second {
            color: #fff;
            margin-top: 5px;
            font-size: 12px;
            line-height: 10px;
            word-wrap: break-word;
            height: 25px;
        }
        .cab-num {
            display: flex;
            margin: 0 auto;
        }
        .cab-num p{
            margin: 0;
            padding:0;
            width: 50%;
            text-align: center;
            color: white;
            /* margin: 5px 10px; */
        }
        .cab-upgrade{
            padding: 25px 0 0 0;
        }
    </style>
</head>
<body>
        <div class="cab Upgrade">
            <div class="describe cab-upgrade">
                <span class="first">机上升舱</span>
                <p class="second">Upgrade</p>
            </div>
            <div class="cab-num">
                <p>1</p>
                <p>2</p>
            </div>
        </div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/fengtingYan/article/details/87369454
今日推荐