本文介绍了如何使用Twitter Bootstrap在右上角放置div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图得到一个包含如下内容的div:
$ b

I'm trying to get a div that contains something like:

You're logged as 'username' (<a href='logout.php'>logout?</a>)

但是当我试图把它放在它的标题下时。这里是我的代码,试着做这个工作。

But when I try to put it in it gets placed beneath my header. Here's my code to try and make this work.

<body>
    <div class="container">
        <div class="row">
            <span6>
                <h1><a href="#">My Header</a></h1>
            </span6>
            <span6>
                <p class="text-right">
                    You're logged in as username (<a href='logout.php'>logout?</a>)
                </p>
            </span6>
        </div>
    </div>
</body>

这会让注销部分出现在右侧,但它会出现在标题下方我希望它与头部位于同一个垂直位置。

This get the logout section to appear on the right side as I want but it appears below the header whereas I'd like for it to be on the same vertical position as the header.

推荐答案

您需要让span6成为一个类一个包含在行中的div

You need to make span6 a class on a div which is contained in a a "row"

<div class="row">
  <div class="span9">
    Level 1 column
    <div class="row">
      <div class="span6">Level 2</div>
      <div class="span3">Level 2</div>
    </div>
  </div>
</div>

这篇关于如何使用Twitter Bootstrap在右上角放置div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 03:20