这是一个让我感到困惑的 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>
文本应该在上图中白框的位置。
最佳答案
关于html - 将 div 移动到 float 元素的右侧,但在另外两个元素的下方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14044516/