Utilize Bootstrap to occupy the rest of the available vertical space

Struggling with handling empty space in a Bootstrap grid? Check out the issue I'm facing when the div doesn't fill the entire height.

https://i.sstatic.net/zvS7t.png

This is the current configuration:

<div class="row">
    <div class="col-lg-8"> <div>diklat bkcu</div></div>
    <div class="col-lg-4"> <div>peserta diklat bkcu</div></div>
    <div class="col-lg-8"> <div>grafik perkembangan gerakan</div></div>
    <div class="col-lg-4"> <div>tabel perkembangan</div></div>
</div>

To achieve this layout:

https://i.sstatic.net/S1Bd9.png

You can use the following code structure:

<div class="row">
    <div class="col-lg-8"> 
        <div>diklat bkcu</div>
        <div>grafik perkembangan gerakan</div>
    </div>
    <div class="col-lg-4"> 
        <div>peserta diklat bkcu</div>
        <div>tabel perkembangan</div>
    </div>
</div>

The challenge now is to create a desktop layout like the second image provided while maintaining a mobile layout that looks like this:

+---------------------------------+
| diklat bkcu                     |
+---------------------------------+
| peserta diklat bkcu             |
+---------------------------------+
| grafik perkembangan gerakan     |
+---------------------------------+
| tabel perkembangan              |
+---------------------------------+

Answer №1

Feel free to give this a shot

<div class="row ">
    <div class="col-lg-8 d-sm-none"> 
        <div>diklat bkcu</div>
        <div>grafik perkembangan gerakan</div>
    </div>
    <div class="col-lg-4 d-sm-none"> 
        <div class="row">peserta diklat bkcu</div>
        <div class="row">tabel perkembangan</div>
    </div>
    <div class="col-sm-12 d-none">diklat bkcu</div>
    <div class="col-sm-12 d-none">peserta diklat bkcu  </div>
    <div class="col-sm-12 d-none">grafik perkembangan gerakan </div>
    <div class="col-sm-12 d-none">tabel perkembangan  </div>
</div>

Are you looking for the mobile version with no spaces like this?


+---------------------------------+
| diklat bkcu                     |
+---------------------------------+
| grafik perkembangan gerakan     |
+---------------------------------+
| peserta diklat bkcu             |
+---------------------------------+
| tabel perkembangan              |
+---------------------------------+

If so, give this approach a try for focusing on the mobile view.

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

Is there a way to link two HTML files containing jQuery within an HTML index file?

I'm currently working on creating an index page for a pair of HTML files that utilize jquery. Let's break down the structure of these files: Emps1, Emps2: These are two HTML tables that start off empty. TabA_stats, TabB_stats: Each HTML file ha ...

Adding an additional stroke to a Material-UI Circular Progress component involves customizing the styling properties

I am attempting to create a circular progress bar with a determinate value using Material-UI, similar to the example shown in this circular progress image. However, the following code does not display the additional circle as the background: <CircularP ...

Activate browser scrollbar functionality

Below is the HTML code snippet: <html> <head> <style> #parent { position : absolute; width : 500px; height : 500px; } #top { position : absolute; width : 100%; height: 100%; z-index : 5; } #bottom { position : absolute; width : 100%; ...

Dynamic styles object for React components with inline styles

I have a styles object let styles = { step_div:{ height:'150px', } } I'm trying to display multiple div elements with different colors using React class Layout extends React.Component{ constructor(props) { super(props); ...

Achieving Content Alignment Using CSS

I successfully implemented a design on my HTML page that divides it into three sections vertically, with each section having a different background color - white, gray, and black. The backgrounds stretch the full width of the page regardless of screen reso ...

IE7 disregards the margin set in a div after a div that has been positioned absolutely

Within a container, I have two divs - the first one with absolute positioning. Strangely, in IE7, the second div doesn't seem to acknowledge the top margin. Padding works fine, but for visual consistency, I prefer using margin. The culprit appears to ...

Multiple occurrences of IP addresses in MySQL

Looking for assistance. I have categories and comments stored with IP addresses. I need to validate all categories for repeated IPs. For each user who uses the same IP twice, add a CSS class (red) to their name. If they use it three times, add another CSS ...

Adding flair to the selected element in the HTML nav bar

I was attempting to customize the appearance of the active item within an HTML navigation bar, which corresponds to the a element. To test this out, I used the example from Here is my modified code, where I introduced a new class "active" and applied the ...

Safari fails to set a div to 100% of its parent's height

Currently, I am developing a website where the layout of a section is structured as follows: <div class="col-md-6"> <section class="right" data-type="background" data-speed="30" style="background: url(<?php echo get_field('book_image& ...

Stacking two divs for the team section layout

Although I'm new to this, I've been struggling to achieve a specific layout for a team page. My goal is to display a picture on the left side and text on the right for each team member. The design includes the person's name, title, and a set ...

Transition within Bootstrap navbar is not as smooth as desired

My bootstrap navbar HTML code is as follows: <nav class="navbar navbar-expand-lg navbar-dark" style="background-color: rgb(50, 50, 50)"> <button class="navbar-toggler" type="button" data-toggle="col ...

The image is not aligning properly within the navigation bar

I had some queries in mind: 1) How can I ensure that the circular profile image on the rightmost side fits within the header without overflowing? 2) How do I properly align the last three images at the bottom (in the "R" class), with adequate spacing bet ...

When adding margin-left and margin-right, images do not appear in their designated positions

I have a chart displaying images, which are showing up correctly. However, I am facing an issue when I try to add some spacing to the chart by using margin-left and margin-right. Here is the CSS code I included: #chart1 { margin: 0 auto; ...

What is the best way to use a button to hide specific divs upon clicking?

Is there a way to use a button onclick event to hide specific divs within a parent div? I've tried using .toggleClass('.AddCSSClassHere') but I'm not sure how to apply it to multiple divs. The jQuery snippet provided only allows me to h ...

What's the best way to align divs vertically in a compact layout?

Update The reason I require this specific behavior is to ensure that all my content remains in chronological order, both on the web page and in the HTML structure. This way, even if the layout collapses into a single column on smaller screens, the content ...

Textarea generated on-the-fly without any assigned value

My goal is to enable users to edit the text within a paragraph on a website. I am attempting to replace the <p> tags with <textarea> tags using the .replaceWith() function. However, when I try to retrieve the value of the textarea, it comes bac ...

`Exploring the magic of CSS image overlay feature`

I would appreciate it if you could walk me through the implementation of this overlay code... .overlay { position: absolute; top: 0; bottom: 0; left: 0; right: 0; height: 100%; width: 100%; opacity: 0; transition: .5s ...

The ScrollToTop feature in MUI component seems to be malfunctioning when paired with the useScrollTrigger hook

I am in the process of developing a custom ScrollToTop component using MUI's useScrollTrigger hook. More information can be found at this link Feel free to check out the sample code here: https://codesandbox.io/s/stackoverlow-mui-usescrolltrigger-er9 ...

Excessive form inputs extend beyond the modal when utilizing Bootstrap 3

Having an issue loading a modal with Angular and populating it with a template. The main problem I'm facing is that the inputs are extending beyond the boundaries of the modal - attached below is a screenshot illustrating the problem: Below is the c ...

Combining two CSS classes to create an "alias"

Currently, I’m utilizing bootstrap for table styling. For instance: <table class="table table-striped main"> However, the table I want to style is dynamically generated by a separate tool that I have no control over, and it already has its own ta ...