脱离文档流的元素,display属性是否发生变化?

答:display隐式的变为block。

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

<head>
    <style>
        span {
            float: left;
        }
    </style>
</head>

<body>
    <span>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Odio, ea accusantium distinctio libero obcaecati
        soluta nesciunt? Ipsa sapiente nam omnis, dicta iure maiores esse at doloribus illum, delectus soluta
        corrupti.</span>
</body>

</html>

已知span为行级元素,设置float:left后:

脱离文档流的元素,display属性是否发生变化?

 

 

上一篇:2021-09-11


下一篇:2021-09-07前端学习日志