Issues with aligning Bootstrap columns

I'm currently in the process of developing a website that interfaces with the Twitch API to display which users, from a predetermined group of 7, are online and offline. The functionality is mostly there, but I'm facing an issue where the top div is not aligning properly with the list of users.

If you want to check out the code, here's the link to the codepen: https://codepen.io/lieberscott/pen/YVZQMG

https://i.sstatic.net/19mjV.png

Here's a snippet of my code:

HTML:

<div class="container-fluid">
  <div class="row">
    <div class="col-xs-3">
    </div>
    <div class="col-xs-6 head">
      <span class="title">
        Twitch Streamers
      </span>
        <table>
          <tr>
            <td id="all">ALL</td>
          </tr>
          <tr>
            <td id="online">ONL</td>
          </tr>
          <tr>
            <td id="offline">OFF</td>
          </tr>
        </table>
      </div>
    </div>
  </div>
    <div id="result">

    </div>
</div>

CSS

$blue: #5D6E81;
$gray: #68636B;
$khaki: #B7D0B9;
$title: #F1EBF2;

img {
  border-color: white;
  border-radius: 50%;
  border-style: solid;
  border-width: 3px;
  height: 50px;
  margin-right: 25px;
  width: 50px;
}

line {
  background-color: $title;
  height: 5px;
}

table {
  float: right;
  font-size: 10px;
  margin-right: 6px;
}

.act {
  background-color: $khaki;
  margin: 1px 0px 1px 0px;
  padding: 8px 8px 8px 15px;
}

.desc {
  color: $gray;
  padding-top: 20px;
}

.desc2 {
  color: $title;
}

.head {
  background-color: $gray;
  color: $title;
  font-size: 40px;
  overflow: hidden;
  padding: 15px 0px 10px 25px;
}

.inact {
  background-color: $blue;
  margin: 1px 0px 1px 0px;
  padding: 8px 8px 8px 15px;
}

.inact a, inact a:hover {
  color: $khaki;
}

.title {
  font-family: 'Days One', sans-serif; 
  font-size: 40px;
}

Is there any way to adjust this code to ensure the width of the top div lines up correctly with the results? Or should I consider reworking it entirely?

(I did manage to align it previously by using a single row and applying each result to a "col-xs-6 col-xs-offset-3" class, but this caused another issue with vertical alignment of the image, username, and status for each result, which I'd like to avoid.)

Answer №1

By mistake, you closed your .container before showing the results. To fix this issue, simply remove the </div> right above the #results wrapper, then paste it below, and everything will align perfectly: Check out this link for an example.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing AngularJS and Bootstrap popover: A guide to effectively implementing "popover-is-open" within an ng-repeat loop

When utilizing ng-repeat to generate a table with items, each item has a button in its row that opens a popover for editing the object. I want to avoid using the click-outside property of the bootstrap popover because I only want the popover to close when ...

Why Chrome Doesn't Alter the State of li Elements

I'm unsure why, but the CSS code in this particular fiddle fails to function correctly on Chrome. On Firefox, when hovering over one of the li elements, the text becomes visible as expected, whereas this does not occur on Chrome. It seems that changin ...

Issues with Bootstrap tabs loading jQuery and Ajax are preventing the proper functionality

I am currently facing an issue with a tab pane designed using Bootstrap. The problem arises when attempting to load external pages into the tabs through Ajax using a jQuery script. While the ajax script successfully loads the content of the pages, I am en ...

"JQuery event handlers not functioning as expected: .click and .on failing

For some time now, I've been facing this issue and I'm at a loss trying to figure it out. I have attempted various solutions such as using .click(), .on(), .delegate, and even utilizing .find() to locate the specific element causing the problem. ...

Unable to properly connect my CSS file to the header partial

I am struggling to include my CSS file in the header partial Here is the link I am using: <link rel="stylesheet" href="stylesheets/app.css"> This is what my directory structure looks like: project models node_modules public stylesh ...

Adjust the width of the mosaic layout to a 50% / 50% ratio

I'm looking to adjust the layout so that each image occupies 50% of the page. Currently, one large image takes up 2/3 of the space and two smaller images take up the remaining 1/3. You can find the images here: To make the large image occupy 50%, yo ...

Disable the height property in the DOM when implementing the jQueryUI resizable feature

I'm utilizing the flex property to create a responsive layout for my web application. In order to enable resizing of my navigator panel, I have implemented jQuery UI. However, upon triggering the resize event, jQuery UI is adding a hardcoded height t ...

Applying a distinct CSS style to the final entry of each list item

Is there a way for me to assign a different style for the last entries in my code? <?= $k % 2 == 1 ? 'news-figure' : 'news-figure-b' ?> ...

What could be causing the discrepancy in the appearance of the Bootstrap cards between the computer and iPad screens?

Could someone please help me understand why the cards on my website appear differently on an iPad compared to a desktop? I have added <meta name="viewport" content="width=device-width"> to the beginning of the HTML document to set the width for the ...

Using either the <h1> or <p> tag within my <div> element disrupts the entire layout

Whenever I add a heading tag or paragraph tag within my div, it causes the content to drop down the screen significantly. I am unsure of the cause and feel a bit overwhelmed by it. I attempted to wrap the <h1> tag in a <div>, as shown below: & ...

Set the background color of the container row to extend the full width, encompassing

I am working on a grid container and I want to change the background color of the second row within it. Check out my Fiddle This is the HTML markup: <div class="totalContainer totalContainer__space"> <div class="totalContainer__ ...

In Angular, changing CSS using jQuery on option tags may require a second click for the changes to take effect

I am implementing an edit button that triggers a bootstrap modal to edit a record: <a href="#" ng-click="getAction(action.id, 'edit')" data-toggle="modal" data-target="#modalEditAction" class="functionalLinks"> < ...

Utilizing Bootstrap to iterate through items in a view

I am facing a small issue. I have multiple products in my shop (the exact number is unknown). On the main site, I want to display only 3 products per row. Unfortunately, my current code only shows one row and it doesn't look appealing. The layout is d ...

Tips for organizing checkboxes in rows horizontally

My question is related to this issue I am trying to arrange my checkboxes in 4 columns horizontally <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> ...

Adjust divs for mobile display using Bootstrap and CSS

I have been struggling with rearranging two divs that are stacked vertically on mobile. I want the second div to appear above the first when the screen size is reduced. Despite trying various methods such as flexbox order and direction, I have not been suc ...

Switching ng-Idle countdown time from seconds to minutes is possible by adjusting the configuration settings

I have implemented ng-idle in my application, where the warning popup appears after 10 seconds with the message: "Your session will be close in 10 seconds" However, I need to change this to minutes. The session should be closed in 5 minutes instead. How ...

Using Angular with Bootstrap to implement a typeahead feature

I've been working on getting my Typeahead feature to function properly: <div *ngFor="let item of items; index as i"> <input type="text" name="name{{i}}" [(ngModel)]="item.name" [ngbTypeahead]="searchItem" /> </div> Within the c ...

Issue with table displaying correctly within a div container in HTML

Having an issue with displaying two tables next to each other inside a div. Despite my efforts to adjust the CSS, they are stacking on top of each other instead of side by side. Here is the code: #contactdetails_table{ width: 500px; height: 190px; ...

Incorporate a corner box feature to bring attention to the typed.js functionality

I have successfully integrated typed.js into my project and now I am looking to replicate the highlighted text with an excel-like box in one corner. I've managed to get the text typing out while also adding an SVG for the box in HTML, but I'm hav ...

designing alternating rows within a table

Can I apply styles to alternating rows in an HTML table using only element hierarchy selectors and avoiding style names? I am tasked with styling the HTML output generated by a server component, which does not include styles for alternate rows. While I co ...