Is there a way to expand "row" elements to the left side in Bootstrap?

<div class="container-fluid">
        <div class="row">
            <!-- Left side -->
            <div class="col-xl-10 style">
                <div class="row" >
                    <div class="col-xl-12 style">Box1</div>
                </div>
                <div class="row" >
                    <div class="col-xl-6 style">Box3</div>
                    <div class="col-xl-4 style">Box2</div>
                    <div class="col-xl-2 style">Box7</div>
                </div>
                <div class="row">
                    <div class="col-xl-3 style">Box4</div>
                    <div class="col-xl-9 style">Box5</div>
                </div>
            </div>
            <!-- Right side -->
            <div class="col-xl-2 style">Box 2 Lorem ipsum dolor sit amet consectetur, adipisicing elit. Rem iure sed recusandae hic laborum, quae earum doloremque illo alias explicabo rerum sequi corrupti magnam, ipsam laudantium cupiditate! Necessitatibus, aliquam eaque?</div>
        </div>
    </div> 

.style{
    background-color: rgb(220, 222, 238);
    border: 1px solid black; 
}

i am looking to modify the layout to adjust the heights of boxes (1, 2, 3, 4, 5, 7). Specifically, box1 should take up half of the height occupied by box6, and the remaining two lines should evenly split between box3, box2, box7 and box4, box5 taking up 25% each.

Answer №1

To ensure proper targeting of your elements, it is recommended to add additional classes (nth-child() can be used if the layout remains consistent).

In this scenario, I included the .left and .right classes to your main elements.

The left class was then assigned as a parent with a flex display setting of column.

Next, all the rows were targeted with a height set to flex: 0 0 25%, making them equal to 25% in height. Additionally, I introduced a class called .half for the first row and adjusted its height using flex: 0 0 50%.

A condensed version (utilizing col-sm-x classes) has been created for quick visualization in the snippet preview. The original code can be found in the second snippet.

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

Unable to post form data into database due to Javascript undefined data situation

I've been working on an HTML form that can interact with a PHP API to retrieve client data and then update user stats in a MySQL database. Currently, I am converting the data into a JSON object and using JSON.stringify to create a string for sending ...

Can microdata be concealed using CSS without any problems?

Imagine having an HTML document filled with a substantial amount of text. Would it be considered "good" (or at least not bad) practice to include elements containing microdata that are hidden from the user's view? For example: <div style="display ...

React app experiencing issues with Bootstrap offset functionality specifically when paired with a button element

I am struggling to position the button after two columns of space in this code snippet. Despite my efforts, the button remains pulled to the left and I can't seem to update it. { values.contact_persons_attributes.length < 2 && <div className= ...

The final li element in the second unordered list is targeted by the selector ul li:last-child

Check out this JsFiddle Having trouble with the pseudo code :last-child. I want the style to apply to the li containing E, but it's affecting the last li in the .subNav. I've attempted a few solutions below, but none have worked. nav ul:first- ...

Connecting Vue.JS page to my existing HTML page: A step-by-step guide

While developing my website, I faced a challenge with the structure. The home page was built using traditional HTML/CSS, while the other pages were created in Vue.js. Is there a method to connect these two different types of files? For instance, can I inc ...

Is it possible to change cases within a switch statement after one case condition has been satisfied?

I am currently working on implementing a game that involves rolling dice in Javascript/jQuery. The game has different "Phases" that the player must complete one by one without any interference from previous phases. The goal is to smoothly transition betw ...

Is an Object in Javascript an Array of Elements?

Today, I am facing a challenge. I have an HTML Form that can contain a variable number of HTML Input Fields for email addresses. I am using Javascript to process this data and to post it via XMLHttpRequest. To fetch the input fields, I use the following c ...

Bootstrap 4 Multilevel Navbar with Bootswatch design positioned on the right side

How can I modify a multilevel Navbar in Bootswatch 4 (Bootstrap 4) to make the Submenus pop open to the left side? The "dropdown-menu-right" class doesn't achieve the desired result. Can someone provide guidance on how the CSS / Javascript should be a ...

What is the best way to enlarge the text in an image input field?

One of the input fields I'm working with looks like this: <input type="image" name="submit" value="submit" src="images/searchb1.png" id="button1"/> I am trying to figure out how to enlarge the text Submit on that field using CSS. Any suggestio ...

Glitch in Safari 6: Round Corners Issue

Greetings! Upon observing the image provided, an unusual behavior can be noticed in Safari 6 concerning round corners. { border-radius: 5px 5px 5px 5px; } Upon hovering over the elements, a thin line appears that seems to accumulate with each subsequent ...

Show and hide a div with the click of a button

As I embark on rebuilding a website from the ground up, I find myself pondering how to achieve a specific functionality: My goal is for another view to appear when one of two buttons is clicked. How can this be accomplished? I attempted the following app ...

Implementing a dynamic header image that adjusts its resolution based on the device and pixel density for

After finishing a design in Sketch, I have 3 unique layouts with header images displayed below: https://i.sstatic.net/fG5T3.png To ensure the height is consistent and to crop the image appropriately on different devices, I export the following images fro ...

The drop-down box options on the web page are not visible to me, but I am able to see them in the element

Having a peculiar issue with two dropdowns on my webpage. The first dropdown works perfectly fine, but when I click on the second dropdown, the options don't show up on the webpage, even though they are visible in the element window. Both dropdowns ha ...

Identifying the origin of the link or button clicked to switch to a different webpage

Imagine you have a button and a link on your website that both direct users to the same next page. Once a user reaches that next page, how can you determine whether they clicked on the button or the link on the previous page? Is there a way to access this ...

Creating a webpage header with Javascript to mimic an existing design

I am in the process of building a website with 5 different pages, but I want the header to remain consistent across all pages. To achieve this, I plan to use an external JavaScript file (.js). The header includes the website name (displayed as an image) an ...

Sturdy and adaptable in a container designed with a responsive width

Currently, I am developing a responsive app and I am facing the challenge of making some parts of the search bar responsive while keeping others fixed in width (like the search icon). I attempted to achieve this using the following code: .wrapper{ ...

What is the best way to achieve complete transparency for an input element?

Is there a way to make the input element completely see-through, allowing the body background image to show through instead of the parent's background color? Sample HTML code: body{ background-image:url("https://upload.wikimedia.org/wikipedia ...

Chrome's struggle with displaying multiple backgrounds on retina screens due to CSS complications

My goal is to create top and bottom shadows for a parent container when scrolling through the content. This effect works perfectly everywhere except on Chrome browser with retina screens, where it behaves strangely. The background becomes stuck at the top, ...

Deciphering the intricacies of Bootstrap 4's navigation

Embarking on a new journey in web development, I am currently enrolled in a webdev course and diving into the world of CSS through Bootstrap. While the instructional videos were based on Bootstrap 3, I am determined to master Bootstrap 4. Currently, I am g ...

Centering the scroll bar with Flexbox

Is it possible to center the scroll bar of a flex box in the middle of the screen? Currently, when using the code below I am seeing the UI as shown below, with the scroll bar at the bottom of the container DIV https://i.sstatic.net/XakpC.png Instead, is ...