Issue with Bootstrap rows overlapping on smaller screens

Basically, the issue I'm facing is that when I reduce the size of my screen, the columns drop below and start overlapping with the row beneath them.

I've been trying to figure out if there's a simple solution that I'm overlooking. But so far, nothing seems to work for me.

Please take a look at the screenshot and code snippets provided below...

#section-headings {
font-size: 44px;
}

h1 {
text-align: center;
color: #ffffff !important;
}

h2 {
text-align: center;
}

#tag-line {
color: #ffffff !important;
}

#main-header {
margin: 0;
}

.jumbotron {
background-image: url(../images/alaska-landscape.jpg);
background-size: cover;
height: 100vh;
width: 100%;
margin: 0;
}

#services {
background-color: #fC99B0;
height: 100vh;
width: 100%;
margin: 0;
}

#services-col {
padding: 80px;
}

#general-text {
text-align: justify;
}

#about {
background-color: #8589FC;
height: 100vh;
width: 100%;
margin: 0;
}

#previous-work {
background-color: #28292D;
height: 100vh;
width: 100%;
margin: 0;
}

.col-md-6, .col-sm-6 {
border-bottom: 0;
margin-bottom: 0;
margin: 0;
}

#glyphicon-image {
display: block;
    margin: 0 auto;
}
<!-- Section 2 Services -->
  <div id="services" class="container">
    <div id="services-row" class="row">
      <h1 id="section-headings">services</h1>
        <div id="services-col" class="col-md-6 col-sm-6">
            <h2>heading 1</h2>
            <p id="general-text">paragraph text 1</p>
            <img id="glyphicon-image" src="images/bar-chart.png" alt="ux-glyphicon" style="width:128px;height:128px;">
        </div>
          <div id="services-col" class="col-md-6 col-sm-6">
            <h2>heading 2</h2>
            <p id="general-text">paragraph text 2</p>
            <img id="glyphicon-image" src="images/domain-registration.png" alt="ux-glyphicon" style="width:128px;height:128px;">
          </div>
    </div>
  </div>

  <!-- Section 3 About -->
  <div id="about" class="container">
    <div id="about-row" class="row">
      <h1 id="section-headings">about site</h1>
      <div class="col-md-6 col-sm-6">
          <img src="..." alt="AboutImage">
      </div>
      <div class="col-sm-6">
        <p>Add the about text here and the about image over there <---</p>
      </div>
    </div>
  </div>

VIEW THE WEBPAGE IN A SMALL RESOLUTION

Answer №1

The issue here is with setting the height to 100vh, as shown below:

#services {
    background-color: #fC99B0;
    height: 100vh;
    width: 100%;
    margin: 0;
}

A better approach would be to set the minimum height to 100vh if you want a section to take up the full height. It's recommended to keep the height and max-height unchanged, so that if the content exceeds the screen size, the element can expand accordingly.

#services {
    background-color: #fC99B0;
    min-height: 100vh;
    width: 100%;
    margin: 0;
}

Answer №2

#section-headings {
font-size: 44px;
}

h1 {
text-align: center;
color: #ffffff !important;
}

h2 {
text-align: center;
}

#tag-line {
color: #ffffff !important;
}

#main-header {
margin: 0;
}

.jumbotron {
background-image: url(../images/alaska-landscape.jpg);
background-size: cover;
height: 100vh;
width: 100%;
margin: 0;
}

#services {
background-color: #fC99B0;
    min-height: 100vh;
width: 100%;
margin: 0;
}

#services-col {
padding: 80px;
}

#general-text {
text-align: justify;
}

#about {
background-color: #8589FC;
    min-height: 100vh;
width: 100%;
margin: 0;
}

#previous-work {
background-color: #28292D;
height: 100vh;
width: 100%;
margin: 0;
}

.col-md-6, .col-sm-6 {
border-bottom: 0;
margin-bottom: 0;
margin: 0;
}

#glyphicon-image {
display: block;
    margin: 0 auto;
}
<!-- Section 2 Services -->
  <div id="services" class="container">
    <div id="services-row" class="row">
      <h1 id="section-headings">services</h1>
        <div id="services-col" class="col-md-6 col-sm-6">
            <h2>UX Design and SEO</h2>
            <p id="general-text">My main area of focus and expertise is in helping businesses to create a strong, appropriate online presence that helps them connect and communicate with there customers in the best way possible.</p>
            <img id="glyphicon-image" src="images/bar-chart.png" alt="ux-glyphicon" style="width:128px;height:128px;">
        </div>
          <div id="services-col" class="col-md-6 col-sm-6">
            <h2>Website Development</h2>
            <p id="general-text">Unlike most UX and SEO consultants, I will not only work with you to design an optimal solution for you and your audience, but I will also implement your solution for you, rather than send you out to fix things on your own.</p>
            <img id="glyphicon-image" src="images/domain-registration.png" alt="ux-glyphicon" style="width:128px;height:128px;">
          </div>
    </div>
  </div>

  <!-- Section 3 About -->
  <div id="about" class="container">
    <div id="about-row" class="row">
      <h1 id="section-headings">about nomadic</h1>
      <div class="col-md-6 col-sm-6">
          <img src="..." alt="AboutImage">
      </div>
      <div class="col-sm-6">
        <p>Add the about text here and the about
        image over there <---</p>
      </div>
    </div>
  </div>

i thinks it's the perfect solution

Answer №3

Insert a div following each container with the class of ,

col-sm-12 pad-0

Then apply the following CSS: .pad-0{padding:0;}

This simple fix should resolve the issue.

Check out the example below:

/*--CSS--*/

   .clrfix{clear:both;}
   #section-headings {
font-size: 44px;
}
 #section-headings {
display: block;
float: left;
width: 100%;
}

h1 {
text-align: center;
color: #ffffff !important;
}

h2 {
text-align: center;
}

#tag-line {
color: #ffffff !important;
}

#main-header {
margin: 0;
}

.jumbotron {
background-image: url(../images/alaska-landscape.jpg);
background-size: cover;
height: 100vh;
width: 100%;
margin: 0;
}

#services {
background-color: #fC99B0;
height: 100vh;
width: 100%;
margin: 0;
}

#services-col {
padding: 80px;
}

#general-text {
text-align: justify;
}

#about {
background-color: #8589FC;
height: 100vh;
width: 100%;
margin: 0;
}

#previous-work {
background-color: #28292D;
height: 100vh;
width: 100%;
margin: 0;
}

.col-md-6, .col-sm-6 {
border-bottom: 0;
margin-bottom: 0;
margin: 0;
}

#glyphicon-image {
display: block;
margin: 0 auto;
}
   @media (max-width: 767px){#services-col { padding:0 10%;}
<!--HTML-->
 

 <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
 <!-- Section 2 Services -->
  <div id="services" class="container">
<div class="col-sm-12 pad-0">
<div id="services-row" class="row">
  <h1 id="section-headings">services</h1>
<div id="services-col" class="col-md-6 col-sm-6">
<h2>UX Design and SEO</h2>
<p id="general-text">My main area of focus and expertise is in helping businesses to create a strong, appropriate online presence that helps them connect and communicate with there customers in the best way possible.</p>
<img id="glyphicon-image" src="images/bar-chart.png" alt="ux-glyphicon" style="width:128px;height:128px;">
</div>
  <div id="services-col" class="col-md-6 col-sm-6">
<h2>Website Development</h2>
<p id="general-text">Unlike most UX and SEO consultants, I will not only work with you to design an optimal solution for you and your audience, but I will also implement your solution for you, rather than send you out to fix things on your own.</p>
<img id="glyphicon-image" src="images/domain-registration.png" alt="ux-glyphicon" style="width:128px;height:128px;">
  </div>
</div>
</div>
  </div>
  <div class="clrfix"></div>
  <!-- Section 3 About -->
  <div id="about" class="container">
<div class="col-sm-12 pad-0">
        <h1 id="section-headings">about nomadic</h1>
<div id="about-row" class="row">
 
  <div class="col-md-6 col-sm-6">
  <img src="..." alt="AboutImage">
  </div>
  <div class="col-sm-6">
<p>Add the about text here and the about image over there <---</p>
  </div>
</div>
</div>
  </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

Working with Ext JS: Dynamically adjusting panel size when the browser window is resized

I am facing an issue with a side panel in Ext.js. Everything is working fine until I resize the browser, at which point some components of the panel get cut off. https://i.sstatic.net/eaEGI.png Is there a way to make the panel resize automatically when t ...

Scroll horizontally within the div before scrolling down the page

After reviewing other questions, it's important to note that the scroll I am looking for is horizontal, not vertical. My goal is to have a div on a page automatically start scrolling when it reaches the center or becomes visible, and then allow the pa ...

Embed Text inside an HTML Canvas

As someone who is relatively new to working with html canvas, I am having a bit of trouble when it comes to containing text within the canvas area. Specifically, I am pulling text from a textarea and displaying it on the canvas, but it seems to stay as one ...

The widths of inputs vary between FireFox and Chrome

I've been investigating why the widths in FireFox and Chrome show a significant difference. This variation is causing a problem with my Modal in the views. Chrome: https://i.sstatic.net/D0lgu.png FireFox: https://i.sstatic.net/do4YU.png Upon comp ...

Ensure that when a user clicks back on an image popup, the page stays in its current position

Is there a way to ensure that after closing a popup image, the browser returns to the same position where it was before? Currently, when I close the popup image, the page scrolls back to the top (as indicated by the red square in the example). However, I ...

How can I incorporate a dropdown menu into my website's navigation using Bootstrap 4 alpha?

This content is based on the Bootstrap v4 Alpha blog theme. I integrated it into a project but encountered issues when trying to add a dropdown menu to the navigation bar. Despite my attempts, the dropdowns did not appear as expected. I included the code ...

Animate text and div elements with bounce or fade-in effects when they appear on the screen in a React application

Animating the elements of my website is a simple task for me, however I am looking to have them animate only when they are visible on the screen without relying on pixels or offsets. I want the animations to be responsive, even in phone mode, without hav ...

What is the best method for sending PHP data to an HTML file?

Once the user logs in, I aim to direct them to a separate HTML page (a landing page) that greets them with "welcome, (user)." I initially attempted to utilize cookies for this functionality but realized it isn't feasible. How can I achieve this? Here ...

Display a scrollbar for the offspring of an element with a flex-grow value of 1

I'm seeking to create a straightforward design consisting of a layered header, main section, footer. My framework of choice is bootstrap 5. The complete layout should occupy all available width and height, with overflow (x and y) set to hidden. Hea ...

Achieving Dynamic Center Alignment for One or Two DIVs

My goal is to create a page layout with three DIVS arranged as Left|Center|Right, while still being able to display different combinations such as Center, Left|Center, or Center|Right in the center of a wrapper div. I have been using jQuery toggle to swit ...

Once the Json content is loaded into the array, proceed to append

I am facing an issue with my ajax function that loads thumbnails. The function is being called by another ajax function, and the parameter is retrieved from there in the loop. I have attempted to wait for the ajax call to finish using .done and .ajaxCompl ...

How to access a shadowroot element using R Selenium

Currently, I'm dealing with web scraping where one of the websites presents a 'Accept cookies' button within a shadow root. To address this issue, I sought assistance on how to click this button in discussions found here: Click on accept co ...

Ways to expand the width of a div on hover - Angular navbar dropdown utilizing Bootstrap 4

I am attempting to make the div full width while also implementing a slideDown/Up effect. I am struggling to identify the specific CSS needed to adjust the width accordingly. Currently, this is what I have: I can see that the class open is dynamically ad ...

Customizing form designs with the combination of Django and Bootstrap

After developing a basic purchase form with custom fields, I conducted a test to ensure its functionality. The form rendered successfully, as shown below. <form id="category_form" method="post" action="/purchase/"> {% csrf_token %} { ...

The Role of Filling in a Process

I am looking to create a rectangle that fills up gradually every day, increasing by 1% each time. This is the basic concept. My main struggle is figuring out how to fill it up. I need the rectangle to increase by 1% of its width each day. So essentially, ...

Is it acceptable to place a <figure> tag inside a <header> tag within an <article>?

Imagine having this scenario: <article> <header> <h1>Article title</h1> <p>Article kicker</p> <figure> <img class="featured-image" src="http://article.com/featured/image. ...

HTML Backup Page

Is there a way I can create a fallback page? For example, my method for updating pages on my website involves deleting the original index.php and replacing it with a separate index.html that displays a "We'll be back soon!" message. This is to notify ...

Enhancing transparency with a touch of background color

After successfully exporting my chart created in canvas as an image file, I noticed that the image turned out to be transparent without any background. Is there a way through code to add a background color to this existing image obtained from canvas? For ...

What is the best way to conceal a CSS div through PHP if the div is empty?

I need some help refining my previous question to ensure clarity. Is there a straightforward method for hiding a div when it doesn't contain any information, without causing confusion for the client? This specific div receives information from Jooml ...

Tips for incorporating Material.io outlined icons within css pseudoelements (::before) usage

I'm attempting to incorporate the Material.io icon into a button using ::before, but it is appearing filled rather than outlined. Unfortunately, there are no available instructions on how to display the icon in an outlined style. This is the code I ...