p标签中的设置成垂直居中对齐

来源:2-10 作业题

晚风142536

2020-02-05 13:32:07

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <title>2-9</title>

    <style>

     .about-top > .middle{

    width: 100%;

    height: 200px;

    margin-top: 50px;

}

    .about-top > .middle > p{

    display: inline-block;

    color: gray;

    text-align: center;

    line-height: 1.5em;

    margin: 0 auto;

}

    </style>

</head>

<body>

    <div class="middle">

        <p>Lorem Ipsum is simply dummy text of the printing and typesetting 

                <br/>insustry.Lorem Ipsum has been the industry's standard dummy 

                <br/>text ever since the 1500s</p>

        </div>

</body>

</html>


写回答

1回答

好帮手慕言

2020-02-05

同学你好,按照本作业的效果图,这段文字水平居中就可以了。可以参考下方:
http://img.mukewang.com/climg/5e3a5f87098be84d04360305.jpg

如果我的回答帮助到了你,欢迎采纳,祝学习愉快~

0

0 学习 · 40143 问题

查看课程