css - Bootstrap CSS - 在列表旁边 float 图像

标签 css twitter-bootstrap joomla

我想让一张图片漂浮在一个无序列表的旁边。

我有以下 HTML:

<header id="header">
    <div class="container">
        <div class="row">
             <div class="col-md-1"><img id="droid-logo" alt="" src="/templates/notthedroidyouarelookingfor/images/ntdyalf-logo.png"></div>
              <div class="col-md-2"><ul class="nav menu nav-pills">
<li class="item-101 current active"><a href="/">Home</a></li>
<li class="item-102"><a href="/index.php/about-us">About</a></li>
<li class="item-106"><a href="/index.php/contact-us">Contact Us</a></li>
<li class="item-114"><a href="/index.php/troubleshooting">Troubleshooting</a></li></ul>
</div>
                        </div>

                    </div>
                </header>

还有我的 CSS:

droid-logo {

float: left;
height: 20%;
margin: 10px;
width: 20%; }

header ul.menu {

border-radius: 4px 4px 0 0;
display: block;
float: right;
margin: 0 10px;
padding: 0;
text-align: left;
width: 70%; }

实际网站在这里: http://notthedroidyouarelookingfor.com/

我不明白为什么图像在菜单下方。

最佳答案

<ul class="nav menu nav-pills">具有 css 属性 position: absolute; .

这可以防止菜单 float 。

尝试使位置相对,然后使用 float 重试(也许您必须将菜单向左浮动)。

关于css - Bootstrap CSS - 在列表旁边 float 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26382328/

相关文章:

javascript - Jquery 向上滑动问题

javascript - 将列表显示为环形缓冲区

javascript - Bootstrap 3 : delete confirm dialog box not work

javascript - Bootstrap 模式 : background jumps to top on toggle

php - lessphp 加载文件 LESS 时出错

javascript - 在 Joomla (1.7.0) 中点击显示嵌套列表

html - 如何强制父元素在调整大小时保持其内容的大小

html - 定心六 Angular

css - 使用 Spring MVC Bootstrap

php - 网站后门 & eval()