Html CSS浮动时髦

Html CSS浮动时髦,html,css,Html,Css,我的花车看起来很奇怪(我想他们的行为应该是这样的),但我似乎不明白为什么。由于某种原因,包含“Alex”的div框总是下到另一行。有什么事我搞砸了吗 style.css .clear { clear:both; } .page-header { width:100%; background:#efefef; border-bottom:1px #ddd solid; padding:3px 10px; margin-bottom:24px; } .

我的花车看起来很奇怪(我想他们的行为应该是这样的),但我似乎不明白为什么。由于某种原因,包含“Alex”的div框总是下到另一行。有什么事我搞砸了吗

style.css

.clear {
    clear:both;
}
.page-header {
    width:100%;
    background:#efefef;
    border-bottom:1px #ddd solid;
    padding:3px 10px;
    margin-bottom:24px;
}
.page-header-title {
    width:200px;
    float:none;
}
.page-header-search {
    float:left;
    width:100px;
} 
.page-header-top_menu {
    float:right;
    width:200px;
}
index.html

<div class="page-header">
        <div class="page-header-search">
            blah
        </div>

        <div class="page-header-title">
            Calender
        </div>

        <div class="page-header-top_menu">
            Alex
        </div>

        <div class="clear"></div>
    </div>

废话
压延机
亚历克斯

非常感谢。

你把它浮错了。如果您交换了

float: none;
对于“日历”-带有

float: left;
“亚历克斯”表现得更好

您没有指定它应该是什么样子


页眉标题
不会浮动,但在浮动时也会起作用。编辑: