Instead of stacking neatly, the Bootstrap rows are overlapping each other

I am currently working on a webpage design using bootstrap. The layout consists of different sections, each containing a bootstrap row within a container.

However, I encountered an issue where new rows are not appearing below the previous row as expected, but rather behind it.

My understanding is that the rows should be stacked below one another. Can anyone help me figure out what might be causing this problem?

Here is an image showcasing the issue: https://i.sstatic.net/M1GpL.png

document.addEventListener("DOMContentLoaded", function(event) {
  const image = new Image();
  image.src = document.getElementById("img-rocket").getAttribute("src");

  // JavaScript code continues...
@import url("https://fonts.googleapis.com/css2?family=Montserrat&display=swap");
/* CSS code continues... */
<head>
  <!-- External links and scripts -->

  <!-- HTML body content -->
</body>

Fiddle representing the problem: https://jsfiddle.net/aeo910rb/

The second row (which appears behind the first row) has a bg-dark class in the fiddle for better visibility of the issue.

Answer №1

It appears that the fixed height of the canvas is the root cause of the overstepping onto the row below. With a set height of 400px, responsiveness becomes a challenge, leading to this issue.

Consider using a relative height for the canvas to ensure it adapts to its parent size and avoids overstepping.

One solution is to set the canvas height to 100% while fixing the parent size. This approach will prevent the canvas from exceeding its parent container.


Additionally, there seems to be a minor problem with responsiveness, as some elements are positioned outside of a div. Excessive padding on the left and right sides may be shrinking the div and causing layout issues. Adjustments to the flex div containing the blue bet buttons could help by setting it as a row or using flex-wrap: wrap for better element alignment.

You can refer to the flex-wrap documentation on MDN for more information.

Illustration below: https://i.sstatic.net/zTJcQ.png

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 apply styling to body element in style.css file when using Node.js

I recently launched a basic Node.js website but encountered an unusual issue. When trying to style the body using the default style.css stylesheet provided by Express, I found that it was not recognizing it. The only workaround was to add the class body di ...

Mobile device scrolling glitch

I'm currently working on my website, which can be found at . After testing it on mobile devices, I came across an issue that I just can't seem to fix. For instance, when viewing the site on a device with 768px width, you can scroll to the righ ...

Hiding overflow when navigating back a page in Safari

I need help finding a solution to this issue. On my website, the results page works perfectly fine until I navigate to a product's details page and then return to the results using the "page before" button. At that point, the overflow becomes hidden, ...

Add styling to a window popup and close it when focus is lost in Ext JS

I am trying to implement a specific functionality where the popup arrow should be at the edge of the textbox as shown in the image below. How can I achieve this? Additionally, how can I make sure that clicking outside the control destroys the popup instead ...

Having trouble viewing the image slider on an HTML webpage

I've been attempting to incorporate an image slider into my personal website on GitHub, but I've encountered some difficulties as the images are not displaying. Interestingly, I can load individual images without using the slider and they show up ...

Issues with PHP not reflecting changes to MySQL database

I'm struggling to find a solution to the issue I'm facing on various forums. The problem involves two pages, an HTML page and a PHP page. The HTML page simply populates a dropdown list from a database column. Below is a simplified version of the ...

Would you like to learn how to set an auto-play video as the background in a webpage section, similar to the one found on http://www8.hp.com/in/en/home.html?

I was browsing the HP-India website and noticed they have a cool autoplay video in the background of a section below the header. I would love to recreate something similar on my own website. Any tips on how to achieve this? ...

Changing class in jQuery ignores CSS style

I have a id="header" div that initially has css rule: padding: 25px 0;. I want to decrease the padding of this div when scrolling down the page. $(document).ready(function() { var headerID = $("#header"); $(this).scroll(function() { if (!$(this).s ...

Enable the choice for Bootstrap collapse animation to be customized

Is there a way to allow users or admins on my website to decide whether or not Bootstrap 4 collapse elements should be animated? The concern is that when many elements are moved by the animation, it becomes less smooth. Therefore, it would be ideal to give ...

Customizing Bootstrap modal backdrop with CSS

I'm exploring how to achieve the backdrop effect of the Bootstrap modal without actually having to load a modal. However, I'm struggling to make it work correctly. Can anyone provide insight into the CSS that the Bootstrap backdrop utilizes inter ...

Customizing div elements in various RMarkdown documents with a CSS file

I want to apply styling to divs in various RMarkdown files using a CSS file. However, I am encountering syntax issues when trying to use the external CSS file to style the div. Embedding the style tag within the rmarkdown body works as shown below: --- ti ...

iPad not compatible with playing Mp4 videos offline

Having an issue with embedding an mp4 file on a webpage in iOS Safari. The video is embedded using the video tag: <video src='gizmo.mp4' width=560 height=320></video> However, instead of playing the video, the page shows the 'v ...

Is there a glitch in my CSS code or am I simply misunderstanding how to center a div?

After doing some research, I noticed that all the tutorials I came across recommended following the same steps. However, when I implemented the code below: .center{ width: 50%; margin: 0px auto; } It centered all six items but didn't align them in 3 ...

What is the best way to customize the text in the navigation bar at the top of the page

I'm having trouble with the Navigation Bar code in my header. The text is not staying within the header and I can't seem to fix it. Is there a CSS solution to keep the text contained within the header? <div class="header"> <img src= ...

If the Ajax request is successful, scroll to the bottom of a Div using jQuery

An interesting scenario arises with this Div that contains user messages, where the newest message always appears at the bottom of the Div and triggers a scroll bar if the message count exceeds the height of the div: <div class="list-group-message" s ...

As the number of lines increases by x%, CSS gradients gradually fade away during the generation process

Is there a way to create a gradient that displays a red line every x% without the colors fading into white? As I add more lines, the red stripes seem to lose their intensity and blend into a white background. The .four-stripes selector creates a good resu ...

Aligning a left-positioned div with a right-aligned div within a container

I'm trying to replicate this layout: https://i.stack.imgur.com/mUXjU.png Here is the HTML code I have so far: <div class="container"> <div class="floatingLeft">A right-aligned div</div> <div class="a">Lorem Ipsum< ...

Leap over in a similar fashion to the provided demonstration

In my attempt to create a unique project, I have created this CodePen example. The goal is to have one ball on the circle that remains in a fixed position, while another rotating main ball must avoid touching it at all costs. Points are awarded for success ...

BlazorBootstrap 5 feature: merging equal-width columns with custom width configurations

I recently completed a tutorial on bootstrap 5 and have a question about its responsiveness. From what I gathered, the rules apply from small to large (e.g. first sm, then md). The initial rule applied is the general rule without sizes (e.g. col-12). Now, ...

Add small pieces of content to CKEditor

Is there a way to add "atomic" block content into CKEditor? For instance, I would like to add <h1>Test</h1> right after the letter "B" in the sentence <p>A B C</p>. Currently, when using CKEDITOR.currentInstance.insertHtml('&l ...