Styling column layouts using Bootstrap

I have a container with one row and two columns, and I want to style the left column to resemble a sidebar: full height and extending all the way to the left. I tried using flex classes but encountered a few issues:

  • The columns don't extend all the way down
  • The text "spreads" out instead of staying centered like before

Code without full-height column:

<div class="container">   
    <form enctype=multipart/form-data action={{url_for('upload_file')}} method="POST" enctype="multipart/form-data"></form>
        <div class="row">
            <div class="col-sm-4 bg-light">
                <br>
                <br>
                <h4>Select a model:</h4>
                <input type="radio" id="logreg" name="model" value="logreg" required>
                <label for="male">Logistic regression</label><br>
                ...
            </div>
            <div class="col-sm-8">
                ...
            </div>
        </div>
</div>

This is what it looks like: https://i.sstatic.net/h4o1V.png

This is the HTML where I attempted to make the left column full height:

<div class="container-fluid d-flex h-100">   
    <form enctype=multipart/form-data action={{url_for('upload_file')}} method="POST" enctype="multipart/form-data"></form>
        <div class="row flex-fill">
            <div class="col-sm-4 bg-light d-flex flex-column flex-fill">
               ...
            </div>
            <div class="col-sm-8">
                ...
            </div>
        </div>
    </form>
</div>

This is what it looks like: https://i.sstatic.net/R9Kej.png

How can I achieve a full-height column while keeping the text alignment consistent with the original design?

Answer №1

Utilizing Bootstrap's height utility classes, such as .min-vh-100, allows you to stretch the height of an element to match the viewport size. By applying this class to a .row div, the flex properties will automatically adjust the column heights to fill the available space.

<div class="row min-vh-100">
  ...
</div>

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 difficulty locating a specific rule within the bootstrap SCSS code

Trying to figure out a puzzling aspect of bootstrap 4, I came across this code snippet: <ul class="nav nav-pills flex-column" id="pills" data-tabsetid="2812"> <li class="active"> <a href=&q ...

Is it possible to use an onclick function to input JavaScript values into a password entry box seamlessly?

Is there a way to input password values continuously using a JavaScript onclick function into a password field? I have two images, one 'Blue' and one 'Red', that trigger an onclick function with the following values: Blue= w3! Red= T4 ...

Switch up the side navigation panel display

Hello, I am a newcomer to bootstrap and I have successfully implemented a collapsing navbar. However, I am looking for a way to make the navbar slide out from the right side when clicked on in mobile view. Can someone provide me with some JavaScript or j ...

Align text to the right using CSS

My website structure is simple: Username: [           ]   | Password: [           ]   | ...

Trouble with z-index functionality in jQuery datatable

I'm struggling to get the Action Box displayed as an upper layer. I've already tried using z-index but it doesn't seem to make any difference. https://i.stack.imgur.com/rJ1vL.png $(document).ready(function () { ...

Use Ionic to inspect a specific value within a JSON array and then add a CSS class accordingly

I've been delving into the world of the ionic framework, working on a simple app to showcase some json data. I managed to style text strings in my ionic list with no issues (story.user), but now I want to change the background color based on different ...

Ways to transition to the subsequent page in Selenium WebDriver following the click of the submit button

https://i.sstatic.net/QWcHm.jpg After successfully automating the process of filling in a textbox and clicking the "proceed with booking" button using a submit() command, I encountered an issue. The HTML code does not provide a URL that can be used in the ...

Deleting the stylesheet exclusively within the confines of the React application window

Here is an image that will help illustrate the issue: https://i.stack.imgur.com/VA7fw.png If you want to check out the code sandbox for this problem, you can visit: https://codesandbox.io/s/annoying-stylesheet-2gpejc?file=/public/index.html I am current ...

Tips for ensuring the final row remains fixed at the bottom of the table while maintaining a minimal body height:

I'm currently working on designing an invoice table using HTML and CSS. I have dynamic rows that are added to the table, and I want the body of the table to have a minimum height to fit around 5-6 rows, after which it should extend based on the number ...

The lower div is overlapping the upper div in a smaller viewport

I have integrated some dashboard widgets in iframes and I want to ensure they are responsive. My goal is for each widget to occupy full width when the screen size is reduced, but appear side by side when the browser window is large (md+): iframe { b ...

Displaying a pop-up to reveal what lies in the background

Whenever I display a popup, the decorative circle appears. I am unsure of how to address this issue. Here is the fiddle link: some code https://jsfiddle.net/MagikMike/pctb9e0n/ Appreciate any help, thank you! ...

The width of the <ul> element does not properly accommodate the width of the <li> elements during the animation that updates the width of the <li>

I am currently working on implementing a typing animation in React. The li element has an animation that recursively changes its width from 0px to 100%. However, I have noticed that when the width of the li changes, the parent ul does not adjust its width ...

Creating a full-screen background image in React and updating it with a button

This issue has been consuming a lot of my time, and though I know the answer must be out there somewhere. My problem is quite similar to what's being discussed here. Essentially, I am trying to dynamically change the background image on button click b ...

Creating a custom design for a button using an external CSS file

I have an HTML code linked to a CSS file where I'd like to style buttons. The button styles are defined in the CSS file. Everything else is working fine, but when I attempt to apply the styled button, it reverts back to a standard HTML button unless ...

Tips for creating extra space on both sides of a Bootstrap container

I am currently working on creating some extra spacing on the left and right of a Bootstrap container. My current approach involves using a 'fluid' container/section and adding margin on both sides to create the desired space. However, the issue ...

How to modify the font color of weekend dates on jquery datepicker

Can I adjust the font color of dates that land on weekends in a jQuery calendar? I attempted to utilize the class ui-datepicker-week-end but it only alters the font color for Sunday and Saturday. My aim is to also modify the color of days that fall on Su ...

Issues with Google Fonts failing to load correctly

Would you mind taking a look at this issue for me? In all browsers except Firefox, the expected behavior is that a web font remains invisible until fully loaded, preserving space on the page. Interestingly, in Chrome and IE9 (the browsers I tested), ther ...

Adjust the dimensions of an SVG element using CSS within an li element's ::before pseudo-element

I'm working on a list where SVGs are loaded as list items. How can I adjust the height and width of the ::before pseudo-element to be 30px x 30px? Setting the height and width directly didn't work for me. Can someone assist with this? <div cl ...

Managing a multilingual website without relying on a database or backend code: Is it possible?

I am in need of translating my small website, which consists of 8-10 pages, into Spanish. Unfortunately, I do not have the resources to work with a backend developer to implement any database or variables. Therefore, I am attempting to tackle this task usi ...

Bootstrap button groups do not support the checking functionality of radio buttons

My bootstrap modal contains a form with two radio style buttons created using the example for normal button styled radio options found here: <form id="changePlanForm" action="/change_plan_submit.php" method="post"> & ...