Troubleshooting the Bootstrap 4 Grid System

I am encountering some difficulties with the grid system in Bootstrap 4. I have a main content section with col-sm-9 and a right sidebar with col-sm-3 float-right. However, the sidebar does not align properly starting from the top, instead it appears just after the end of col-sm-9. I want both columns to be perfectly aligned.

This is how the page currently looks: https://i.sstatic.net/2IMYJ.png You can view the code for the page here: Code

Below is my current HTML structure:

<section class="row clearfix" ng-cloak>
<div class="content-top no-gutters">
<div style="background-image: url({{post.better_featured_image.source_url}});" class="content-tracks-image">
</div>
    <div class="content-featured-image">
            <img>
    </div>
</div>  

<div class="clearfix"></div>

<div class="gs-track col-sm-9"><!--start player-->      
<!---player--->
</div><!-- close player -->
<div class="col-sm-9 bg-white pt-3 pb-3" ng-cloak><!-- start content-->
<!--content->
</div><!-- close content -->
<div class="col-sm-3 float-right pt-3"><!-- start sidebar -->
<!-- sidebar -->
</div><!-- close sidebar -->

</section>

I managed to align the sidebar with the content by moving the sidebar box before the player, but this is not the behavior I want to maintain.

Answer №1

Working with the link provided was a bit challenging as the content did not display correctly when running the HTML. However, after manually entering my own content and attempting to recreate the layout, I discovered that utilizing Bootstrap's ROW within a container div proved effective.

<div class="row">
    <div class="col-sm-9">CONTENT</div>
    <div class="col-sm-3">SIDEBAR</div>
</div>

Give it a try and let me know if it solves the issue.

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

Having trouble eliminating the underline on Vue router-link?

I've experimented with various approaches in an attempt to remove the underline from router-link. This is the code I have: <router-link :to="{name: 'Plan'}"> <div>Plan Your Trip</div> <div class=&apos ...

Display a PHP warning message when attempting to add methods to ajax jQuery

Recently, I have delved into the world of ajax and jQuery while working on my final year project. However, I have encountered a problem when adding methods to my JavaScript code. Here is an excerpt from my ajax script: $(document).ready(function() { $ ...

Can CSS styling be applied to lazy-loaded images using Gatsby and Sharp before they finish loading?

I am utilizing Sharp to implement lazy loading for images on my Gatsby website. Currently, the images appear blurry and only come into focus once they enter the screen. Is there a method to add CSS styles or filters to these blurry images while they are s ...

Dynamic text display using Bootstrap 3

My current struggle involves the implementation of Bootstrap's collapse class in my project. I am attempting to connect buttons with text located in a separate div in order to properly collapse and display it. While I can easily achieve this in a str ...

Animate horizontal scrolling with jQuery when the user scrolls the mouse

I've been experimenting with an animated horizontal offset for a div element triggered by the mousescroll event. You can check out my progress so far by following this link - could someone please take a look and help me identify any issues? Currently ...

Seeking help with h2 headings, nested hyperlinks, and clickable images

Attempting to tackle a homework question today. This is the task at hand.... List a variety of foods in the following categories: Sandwiches, Drinks, Desserts. Use h2 tags to create these categories. Under each category, create a nested list that inc ...

Creating a page turn effect during the loading of a page within an iframe

Is there a way to create a page turn effect similar to reading a book for an iframe that is loading dynamic content? Any suggestions would be greatly appreciated. Link: ...

Using setAttribute does not function properly with ngModel within Angular framework

I am attempting to automatically assign ngModel while creating an HTML element. Here is my code: productName.setAttribute('[(ngModel)]', `customProductName`); However, I am encountering the following error: Failed to execute 'setAttribute ...

What are the choices for the active element in a bootstrap navbar?

Is there a way to highlight the active element in bootstrap 4? Right now, Home is the active element, but it doesn't stand out enough. https://i.sstatic.net/5tKBx.png <li class="nav navbar-nav "> <a class="nav-link {{ Request::is(&apos ...

Using jQuery to toggle the visibility of divs depending on the selection of multiple checkboxes

I found this code snippet that I need help with. <div class="row"> <div class="col-xs-4"> <label class="checkbox-inline"><input type="checkbox" value="draft">Draft</label> </div> <div class="c ...

What steps can I take to ensure that my DIV completely surrounds the floating DIVs within it?

Having an issue with my CSS. The problem arises in a specific area of my screen where there are variable numbers of buttons enclosed within a DIV named sbr_btn. The layout is as follows: Outer DIV Outer DIV Outer DIV 01 02 03 04 05 06 07 08 ... ...

Adding a uniform header and footer across all pages simultaneously in HTML

I am currently working on a project where I want to apply the same header and footer design from my homepage to all pages. However, I need a method that allows me to update the header and footer in one place, so that any changes I make will automatically r ...

I am looking to bring in just the tables from a different html/php page

I am currently working on a webpage that includes a php library, header, and other elements. I only need to import specific tables and information from this page onto another screen display, with the tables arranged side by side instead of vertically. My ...

Ways to darken a theme when displaying a pop-up

I recently added a pop-up feature to my portfolio website and utilized Bootstrap classes to enhance its functionality. In order to make the pop-up object more prominent, I wanted to darken the background when opening the pop-up. However, some elements in t ...

Troubleshooting a Bootstrap flex problem

<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b4d6dbdbc0c7c0c6d5c4f4809a849a84">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/> <div classNam ...

What makes the element[class=noquotes] function so effective?

According to the MDN attribute selector in CSS, it has the following syntax: div[attr="actualValue"] For example: <div class="test"></div> div[class="test"] However, I have observed that the quotes around the test are not necessary as show ...

Creating HTML inputs dynamically using jQuery in an ASP.NET application

I have written this JavaScript code to dynamically generate and add HTML elements within my asp.net webform: var i = 0; function addFields() { i++; var quantity = '<td class="auto-style2"><input type="text" size="3" name= ...

Validation of form fields based on conditions

Currently, I am working on validating specific fields within a form based on a particular condition. The condition states that if a checkbox is selected, then the fields below must be filled out and are required. If the checkbox is not clicked, then thes ...

The system has removed all content within the fields

I have created a code to generate a dynamic table. The problem I am facing is that when there are multiple rows in the table, clicking on the delete button deletes all field values instead of just deleting the data for the specific row where the delete b ...

Tips for customizing text field appearance in Safari and Chrome

I haven't had a chance to test it on IE yet. My goal is to create a unique style for the background image and text box shape, along with borders, for the search bar on my website, [dead site]. If you check it out on Firefox or Opera and see the sear ...