Struggling to line up columns using Bootstrap 4

Currently, I am delving into web design and working on a mock website. My knowledge of Bootstrap, CSS, and HTML is limited, which has led me to encounter some challenges. Despite dedicating the entire morning to this project, I find myself stuck with aligning the text section of my div to the right of the videos. While I've managed to shift it to the right, I'm struggling to position it alongside the videos within the background container. It appears that the column arrangement might be causing an issue since the video columns extend all the way across the page, potentially hindering the last one from moving up. I hope this explanation makes sense.

I've experimented with various display and float options, as well as tried separating and blending rows, but haven't made any significant progress.

Here's the HTML Code and CSS:

<!--CONTAINER MAIN ABOUT INFO-->
<div class="page-header">
    <h2>About Us</h2>
</div>
<div class="container container-about">
    <!--VIDEOS-->
    <div class="row videos">
        <div class="col-md-4 vid1">
            <div class="embed-responsive embed-responsive-16by9">
                <iframe class="embed-responsive-item" width="560" height="315" src="https://www.youtube.com/embed/afRUIVxTGls" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
            </div>
        </div>
        <div class="col-md-4 vid2">
            <div class="embed-responsive embed-responsive-16by9">
                <iframe class="embed-responsive-item" width="560" height="315" src="https://www.youtube.com/embed/NNgRnJIjXM4" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
            </div>
        </div>
        <div class="col-md-8 about">
            <p><strong>lorem epson etc</p>
        </div>
    </div>
</div>
<!--END OF MAIN ABOUT INFO-->

CSS:

.videos {
    display: inline;
}

.about {
    float: right;
}

view image snapshot here

Answer №1

Bootstrap's grid system is structured around a 12-column grid layout. To have content displayed side-by-side on the same row, the total column classes should add up to 12 or less. Currently, in that particular row, you have columns with sizes of 4, 4, and 8— totaling 16:

<div class="container">
    <div class="row">
        <div class="col-md-4"></div>
        <div class="col-md-4"></div>
        <div class="col-md-8"></div>
    </div>
</div>

If you intend for the first two columns to each take a quarter of the row, and the third one half, you should use 3 + 3 + 6 = 12 instead:

<div class="container">
    <div class="row">
        <div class="col-md-3"></div>
        <div class="col-md-3"></div>
        <div class="col-md-6"></div>
    </div>
</div>

(By the way, remember to close that <strong> tag.)

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

When the parent container is given a specific height, the Flexbox item on iOS 9 appears to be shrunk down

Encountering a bug on iOS version 9 while using the latest Bootstrap 4 Beta. The issue involves a parent div and ul element with multiple list items. The parent div is a flexbox with set dimensions and overflow enabled for child elements. The list item sho ...

Include a scroll bar for menu items that contain submenus, while ensuring that the submenu items remain visible

Looking for a way to add a scrollbar to the courses menu list due to its excessive length (refer to the image below). The fixed top navbar prevents scrolling, making it necessary to implement a scrollbar within the menu itself. After applying the followin ...

Having trouble retrieving information from the weather website

Hello, I am interested in extracting weather information from a specific website: On this website, there is a search bar that allows users to enter the name of any city in India. Upon pressing 'Go', the user is directed to a page displaying the ...

Looking to extract the hidden value from an HTML input field using Selenium

Unable to retrieve the value of a hidden element in HTML, even though it is displaying. Seeking assistance in accessing the value despite the type being hidden. <input type="HIDDEN" label_value="Sub Reference" title="Sub Reference" id="ACC_NO" dbt="BK_ ...

HTML with embedded PHP script

i cannot seem to display mysql data in html format. the table i am working with is called App appid | app | version | date | apk file | 1 sample 1.0.0 2012-10-12 sample.apk //here is the mysql query ...

Ways to repair a website iframe malfunction

Whenever I visit this specific URL : (note: using an Ad-blocker is recommended) The link to the webpage loads properly, with no issues. However, attempting to load the same page through an iframe in my HTML code triggers an error: Here is my HTML code : ...

having difficulty uploading an image on wampserver

I am seeking advice and assistance with an issue I am facing. I am attempting to upload an image, but Wampserver keeps displaying the following error message (Warning: POST Content-Length of 80237 bytes exceeds the limit of 750 bytes in Unknown on line 0 F ...

The Evolution of Bulma's Navigation Menu

Creating a transparent menu in Bulma has been successful for the desktop viewport: VIEW DESKTOP MENU However, when attempting to implement the same design on mobile, the menu ends up like this: VIEW MOBILE/TABLET MENU The mobile version seems to inheri ...

Utilize Bootstrap button dropdown to automatically assign a selected value to a list item

I have a form with a select box that transforms into a bootstrap button after the page loads. However, I am unable to set the selected value for the converted bootstrap button drop-down li. <button type="button" class="btn dropdown-toggle btn-default" ...

Text not centered evenly on the page

My goal is to center my "Jumbotron" at the top, with my picture on the left and carousel on the right. However, all my content keeps floating to the left. Despite using Bootstrap 5 with flexbox, I can't seem to get everything centered properly. Check ...

Is there a way to properly align unordered lists (such as a navigation menu) within a div with a width set at

UPDATE: I found a creative solution to my issue. By adding margin-left and margin-right set to auto, along with fixing the width of the nav menu to 1002px and setting its positioning to relative, I was able to achieve the desired effect. Additionally, I cr ...

Is it possible to use the .focus() event on an entire form in JQuery? If so, how

Take a look at this HTML snippet: <form ....> <textarea>....</textarea <input .... /> </form> I'm trying to set up a help section that appears when the user focuses on any form element, and disappears when they lose ...

HTML Elements for Displaying Undefined JSON Information

Hey there, I'm new to programming and I'm looking to display JSON data in an HTML table using jQuery. The issue I'm facing is that the output from the server shows up as 'undefined'. My goal is to have a constantly updated list of ...

Having trouble aligning page in the center with flexbox and styled components

Hey there, I'm having some trouble figuring out how to center my page using flexbox within styled components in a Next.js app. Any suggestions or tips? Let me share with you my Blog Component import ReactMarkdown from 'react-markdown' impor ...

What is the best way to select an element based on its relationship to another Element object using a selector?

I am currently developing a small library in which I require the ability to select a relative element to the targeted element using the querySelector method. For instance: HTML <div class="target"></div> <div class="relative"></div& ...

Ways to prompt a specific text value to generate varied responses

Whenever I try to input the letter "h", I expect a specific value in return but for some reason, it's not working as intended. Despite my best efforts to troubleshoot the issue, I have been unsuccessful in finding a solution. It's frustrating bec ...

Tips for executing an Angular controller prior to DOM initialization

I have some code in my Angular controller that I want to run when the document is ready, but Angular currently runs it as the DOM is being created. While this does produce the correct output, it also generates console errors because initially the image src ...

Clone content upon pressing the Enter key

I am facing an issue with my editable container where I have a div inside it. Whenever I press enter, the div duplicates, resulting in two divs stacked on top of each other. The container has contenteditable set to true, which might be causing this problem ...

My goal is to extract the usernames of all sellers from the Poshmark webpage using a combination of JavaScript, Cheerio, and Axios

After experimenting with various methods, I've come close to the solution, but it only retrieves one of the div elements I'm looking for... Although I managed to retrieve multiple divs at one point, when I attempted to extract text using the .te ...

Giant Slide - navigate directly to a particular slide using a link

Hey there, I am currently working on incorporating the Superslide slider for fullscreen images in my website. My goal is to have a mostly text-free site where users can navigate through the images using the main menu or jump to a specific image within the ...