2018.3.29 div内容格式设置

时间:2021-06-26 15:52:42

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
            *{
                font-family: "微软雅黑";
            }
            #a{  /*div宽度*/
                width: 600px;
                /*div高度*/
                height: 600px;
                /*边框宽度,显示,颜色*/
                /*border: 1px solid black;*/
                border-bottom: 1px solid brown;
                border-top: 1px solid brown;
                border-left: 1px solid brown;
                border-right: 1px solid brown;
                /*背景图片*/
                background-image: url(img/wangzuxian.jpeg);
                /*背景图片平铺设置*/
                background-repeat: no-repeat;
                /*背景图片尺寸*/
                background-size: 80% 80%;
                /*背景图片在DIV中的位置*/
                background-position: bottom;
                /*字体颜色*/
                color: deeppink;
                /*字体尺寸*/
                font-size: 60px;
                /*字体格式:倾斜*/
                font-style: italic;
                /*字体宽度:加粗*/
                font-weight: bolder;
                /*字体标注:下划线*/
                text-decoration: underline;
                /*字体水平居中*/
                text-align: center;
                /*字体垂直靠顶部*/
                display: table-cell;
                vertical-align: auto;
            }
        </style>
    </head>
    <body>
        <center>
            <div id="a">风华绝代</div>
        </center>
        /*字体首行缩进40em*/
        <p style="text-indent: 40em; color: deeppink;">王祖贤</p>
    </body>
</html>