Html 同一行上的两个div

Html 同一行上的两个div,html,css,Html,Css,为什么这两行“第一个文本”和“第二个文本”不在同一行 <html> <body style="width: 20px;"> <div style="width: auto; display: block; white-space: nowrap;"> <div style="display: inline-block; float: left;">First text</div>

为什么这两行“第一个文本”和“第二个文本”不在同一行

<html>
    <body style="width: 20px;">
        <div style="width: auto; display: block; white-space: nowrap;">
            <div style="display: inline-block; float: left;">First text</div>
            <div style="display: inline-block; float: left;">Second text</div>
        </div>
    </body>
</html>

第一个文本
第二文本

因为您正在浮动元素

移除
浮动:左,或使其
显示:块

另见:


第一个文本
第二文本

因为您正在浮动元素

移除
浮动:左,或使其
显示:块

另见:


第一个文本
第二文本

float:left
取消显示:inline


第一个文本
第二文本

float:left
取消显示:inline


第一个文本
第二文本

使用
浮点:无
显示:内联块
使用
浮点:无
显示:内联块