0

Something is wrong with the sidebar not standing its ground compared to the pill content. The result of this code is basically the <aside> gets shoved in the upper left corner next to the pill tabs while the pill content is spread all beneath it and anchored at the left. I've tried quite a few CSS tricks (margins, widths, etc.) but nothing seems to snap it to center the content (which are microposts).

Relevant CSS:

.nav-pills > .active > a,
.nav-pills > .active > a:hover,.nav-pills > li > a:hover {
float:none;
display:inline-block;
*display:inline;
zoom:1;
text-decoration: none;
font-weight: bold;
border-radius:0px;
border-bottom-width: 4px;
border-bottom-style: solid;
border-bottom-color: #000000;
    color: #000 !important;
  background-color: transparent !important;
}
.nav-pills {
    border-radius:0px;
    text-align: center;
}

Relevant ERB:

<% provide(:title, @user.name) %>
<div class="row">
  <aside class="col-md-4">
    <section class="user_info">
      <h1>
        <%= gravatar_for @user %>
        <%= @user.name %>
      </h1>
        <% if @user.admin? %>
        <span class="label label-warning">Administrator</span>
        <% end %>
      <br>
      <br>
      <br>
      <br>
      <div style="color:grey">
          <% if current_user.admin? %>
          <%= @user.email %>
        <% end %>
        <br>
        <%= @user.activated_at.strftime("Joined: %m/%d/%Y") %>
      </div>
    </section>
  </aside>

 <div class="col-md-8">
    <ul class="nav nav-pills">
        <li class="active">
            <a data-toggle="pill" href="#microposts">Posts (<%= @user.microposts.count %>)</a>
        </li>
        <li>
            <a data-toggle="pill" href="#events">Events (Insert count here)</a>
        </li>
    </ul>
  </div>
</div>

<div class="tab-content">
  <div id="microposts" class="tab-pane fade in active">
    <% if @user.microposts.any? %>
      <ol class="microposts">
        <%= render @microposts %>
      </ol>
      <%= will_paginate @microposts %>
    <% else %>
        No posts yet.  Create one on the sidebar.
    <% end %>
  </div>
  <div id="events" class="tab-pane fade">
    <p>Events brah</p>
  </div>
</div>
Mr Lister
  • 45,515
  • 15
  • 108
  • 150
A13X
  • 409
  • 1
  • 6
  • 27

1 Answers1

0

What ended up happening is the <div class="tab-content"> needed to be inside the row and col-md-6 divider tags so that it still recognized that centering had to occur. Otherwise, similar questions on here about centering pill and tab content are spot on: Twitter Bootstrap: Center Pills

Clearly I could use some more CSS training, sorry for the time spent mulling over this problem.

Community
  • 1
  • 1
A13X
  • 409
  • 1
  • 6
  • 27