css - float 的CSS问题

标签 css css-float

<分区>


想改进这个问题吗? 通过 editing this post 添加细节并澄清问题.

关闭 9 年前

这是我的问题:

http://dl.dropbox.com/u/31659128/buildworx/site-v2/project/index.html

截图:enter image description here

我似乎无法正确 float 。

 header, nav { margin: 0 auto 30px auto; width: 960px; }

header #ip-wrapper { float: right; width: 375px; }
header #ip-wrapper .ip-wrap { background: #636363; background: -webkit-linear-gradient(top, rgba(125, 126, 125, 1) 0%,rgba(58, 58, 58, 1) 100%); margin: 10px 0; border-radius: 20px 5px 5px 20px }
header #ip-wrapper .ip-wrap .ip-name { background: #e5e5e5; background: -webkit-linear-gradient(top, rgba(242,242,242,1) 0%,rgba(229,229,229,1) 100%); display: inline-block; padding: 10px 12px; border-radius: 5px 0 0 5px; margin: 0 10px 0 0 }

最佳答案

在图像上使用 float:left。

<img src="images/logo.png" alt="bw" style="float: left;">

您的#ip-wrapper 当前正试图 float 在某个内联对象的右侧。这就是导致您出现问题的原因。

关于css - float 的CSS问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7327920/

上一篇:html - 推荐的CSS和HTML清理和修复软件

下一篇:html - 为什么我最近的帖子框的文本会溢出?

相关文章:

html - 在 IE7 中不显示 float div

jquery - 内容高于页脚

css - margin 顶部不适用于清除 : both

css - 垂直对齐 float 元素

html - 表格滚动条

css - 如何使两个左浮动的div垂直

html - 段落的文本不会呈现在 float 图像下方,但段落本身会呈现

mobile - Opera mini 中的媒体查询 - 显示不正确

css - Font Awesome 在客户端环境中不起作用

javascript - Episerver CMS,我想使用 CMS 发布一个简单的通知。我不熟悉 CMS。