0

这是一个让我难以接受的 CSS 问题。下面是我目前拥有的代码,我希望描述文本位于蓝色框的右侧(即标题下方),但要在“按钮”下方继续。我尝试了各种组合,但它们要么从当前位置开始,要么在标题下方但按其宽度缩进。

非常感谢任何帮助

<html>
    <head>
        <style>
            body { background-color: #fff; color: white; }
            .outer { width: 850px; height: 400px; background-color: #000; }
            .logo {float: left; width:150px;height:150px;background-color: #00f;}
            .button {float: right; height: 60px; width: 80px; background-color: #f00; }
            .title { font-size: 60px; float:left;}
            .desc {clear:both;}
        </style>
    </head>
    <body>
        <div class="outer">
            <div class="head">
                <div class="logo">oo</div>
                <div>
                    <div class="title">Title</div>
                    <div class="button">button</div>
                    <div class="desc">description text description text description text description text description text description text description text description text description text description text description text description text</div>
                </div>
            </div>
        </div>
    </body>
</html>

例子

文本应该是上图中白框所在的位置。

4

1 回答 1

1

现在这应该很简单吧?只需将它浮动到左边并给它一个宽度......

演示

CSS

.desc {
    float: left;
    width: 650px;
    padding: 10px;
}
于 2012-12-26T18:39:17.687 回答