user3822168
user3822168

Reputation: 27

How to place a div in the top right corner using Twitter Bootstrap

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.

Upvotes: 2

Views: 6858

Answers (1)

gh9
gh9

Reputation: 10703

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

BootStrap

<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>

Upvotes: 3

Related Questions