More content will not be displayed beneath folded DIVs arranged to stack on mobile devices

On my website, I have two separate sections dedicated to use cases and benefits. Here is the code:

.onboardmessaging {
    min-width: 100%;  
}

.onboardmessagingwrap {
    min-width: 100%;  
}

.usecase {
    padding-left: 8vw;
    max-width: 50%;
    float: left;
}

.benefits {
    padding-right: 8vw;
    max-width: 50%;
    float: right;
}

@media only screen and (max-width: 500px) {
.usecase {
    padding-left: 0;
    min-width: 100%;
    float: left;
}
}

@media only screen and (max-width: 500px) {
.benefits {
    padding-right: 0;
    min-width: 100%;
    float: right;
}
}
<div class="onboardmessagingwrap">
  <div class="onboardmessaging">
    <div class="usecase">
       <p class="title">Title</p>
       <p class="sentence">1</p>
       <p class="sentence">2</p>
       <p class="sentence">3</p>
       <p class="sentence">4</p>
    </div>
    <div class="benefits">
       <p class="title">Title</p>
       <p class="sentence">1</p>
       <p class="sentence">2</p>
       <p class="sentence">3</p>
       <p class="sentence">4</p>
    </div>
  </div>
</div>
<br>
<p>Why does this sit underneath and not below the lists?</p>

While these sections align perfectly next to each other, any additional content on the page appears below them instead of alongside. Despite closing all DIVs properly and adding an extra one, the issue persists.

The question

Why does this sit underneath and not below the lists?
should be displayed below the content.

If anyone can provide assistance, it would be greatly appreciated. Thank you in advance.

Answer №1

If you want to clear the float, one common way to do so is by using this method.

Instead of the

    <br>

You can use

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

and then make sure to add this CSS snippet:

    .clearfix::after {
      content: "";
      clear: both;
      display: table;
    }

Another option is to apply the clearfix class to the onboardmessagingwrap div for the same outcome without the need for an extra unnecessary div.

For further details on CSS floats, check out: https://www.w3schools.com/css/css_float.asp

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

Selecting options from a pop-up menu

I've created a dropdown menu with what seems to be correct code. However, there are no errors showing up, but the selected item from the menu is not alerting as expected. Here is the jsfiddle link $(document).ready(function () { // This function ...

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 ...

Incorporating Masonry-inspired images into a website's design section

I have been working on incorporating a masonry layout of images into my website, but I am facing alignment issues. The images are simply stacking on top of each other instead of creating the desired masonry effect. Are there any tips on how to create a mas ...

What method does the CSS standard dictate for measuring the width of an element?

In terms of measuring an element's width, Chrome appears to calculate it from the inner margin inclusive of padding. On the other hand, Firefox and IE determine the width of the box from the border, excluding padding but including the margin. Personal ...

Can you identify the attribute used for marking up an HTML code tag?

While examining a website's code to understand how they styled a specific section of their page, I came across the following snippet: <code markup="tt"> I thoroughly checked for any other references to this particular markup attribute ...

How to eliminate vertical spacing between rows in Bootstrap?

I am looking to eliminate the unsightly vertical spacing between the bootstrap rows displayed below: https://i.sstatic.net/dgR2z.png The code appears as follows: <div class="outerbox container-fluid vw-100"> <div class="row vw-100 justify-co ...

Is it possible to invoke a JavaScript function from within a CSS file?

Currently, I am focusing on developing responsive web design and looking for ways to avoid creating multiple versions of each page based on screen width variations. The struggle lies in managing font sizes effectively. While attempting to style them using ...

Creating a customized Paypal form with user-selected options

I want to make it easy for visitors to my website to pay through Paypal by simply clicking on a link that will take them directly to the checkout page. What I'm looking for is a way to provide basic options such as: Allowing users to enter their na ...

Creating a basic image carousel with JavaScript, CSS, and HTML

After running the code, I encountered an issue where the first image displays but then after one second, only a white blank screen appears with no further action. It seems like there may be an error in the JavaScript code. Below is the code that was attemp ...

Using image paths in CSS for styling purposes

As I develop an Asp.net website, I've encountered a surprising issue. Here is my folder structure: - Styles - master.css - Images -webPages -scripts When trying to access an image in the Images folder from the CSS file, I receive a ...

Using HTML nested lists in Wordpress sites

Working on nested, ordered lists using ol types and encountering an issue where the code appears correctly in Wordpress preview but displays incorrectly in Firefox and IE. The lists are showing as numbered instead of the specified types in the code provide ...

Bootstrap's landing page problem

I am currently working on creating a landing page using bootstrap and have encountered an issue with the text alignment in my section containing icons and tags. In order to make the text appear clean and concise, I want the text to be displayed in either o ...

Alter the style attribute using JavaScript

I have a calendar table row that needs to be displayed or hidden based on the month. HTML: <tr id="bottomrow" class="week" valign="top" style="display:none;"> <td class="day" id="d36"> <div class="daynumb" id="x36">& ...

using jQuery to disable textarea input

I have this HTML code and I am using jQuery: <div><textarea style="height: 150px; width: 250px" name="myName" id="myId" class="text ui-widget-content ui-corner-all" > </textarea></div> Currently, I validate this field after the su ...

Endless Google Locations Instances

My database entries are being displayed in a table using input fields. I want the Location field for each entry to be automatically completed using Google's API. HTML: <input name="edit_airplane[1][location]" type="text" class="airplane_location" ...

Guide on including a dropdown-item within the navbar

I've implemented a header with a navbar inside. I want to create a dropdown menu element, but for some reason, my item is not appearing. On this link, it looks simple: https://getbootstrap.com/docs/4.0/components/navs/ Pills with dropdowns <l ...

Tips for naming multiple select options for form submission---Different ways to name

Struggling with multiple selects in a form? Find out how to name them correctly here. Take a look at this example: <form action="/product/create" method="post"> <table> <tr> <td> <input type="text" na ...

What is the best way to split a Bootstrap col-md div in half vertically?

I am attempting to create the following layout using the Bootstrap grid system. Within a container <div class="row">, there are two divs occupying half of the width each (<div1> and <div2>). The height of <div1> will vary based on t ...

Implementing asynchronous image loading with Angular 4 using bearer headers

Currently, I am working on making asynchronous image requests with authentication headers. The image paths in the code look like this: <img src="{{file.src}}"/> I need to include a Bearer Token in the header for these requests, but since there are ...

Organize your table with CSS styling

Looking for a way to rearrange a table with 2 columns after every 2 rows so that the lines continue on the right side? Check out the example below: [1][2] [1][2][5][6] [3][4] => [3][4][7][8] [5][6] [7][8] Wondering if this can be achieved using o ...