013display的使用

代码:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>display的使用</title>
        <link rel="stylesheet" type="text/css" href="../css/019.css"/>
    </head>
    <body>
        <div>块级元素:独占一行</div>
        <span>行内元素:不独占一行</span>
    </body>
</html>
div{
    width: 180px;
    height: 100px;
    border: 1px solid #0000FF;
    /* display: none; 此元素不会被显示。*/
    display: inline-block;/*是块元素,但是可以内联,在一行!*/
    /* display: inline;行内元素 */
}
span{
    width: 180px;
    height: 100px;
    border: 2px solid #000000;
    
}

 

运行结果:

 

 

posted @ 2021-08-13 22:21  李林林  阅读(36)  评论(0编辑  收藏  举报