Bootstrap columns causing a collision

My website has a problem when viewed on mobile at 320 x 480 resolution. Two columns filled with text collide and mash up the text together. I initially tried without using columns, just "container-clearfix," but that did not resolve the issue.

Check out this image showing how the text appears on small mobile screens at 320 x 480: image 1

Here is the JS Fiddle link for reference: http://jsfiddle.net/52VtD/14124/

#big-image {
  position: relative;
  z-index: -1;
  width: 100%;
  height: 600px;
  background-repeat: no-repeat;
  background-size: cover;
}
.col-md-12 {
  padding-left: 0px;
  padding-right: 0px;
}
#text-four {
  position: absolute;
  overflow: hidden;
  text-align: center;
  bottom: 450px;
  vertical-align: middle;
  left: 20%;
}
#text-four-p {
  position: absolute;
  overflow: auto;
  bottom: 830%;
  left: 15%;
  text-align: center;
}
.US {
  position: absolute;
  overflow: auto;
  bottom: 250%;
  left: 15%;
  text-align: center;
}
.EU {
  position: absolute;
  overflow: auto;
  bottom: 250%;
  right: 15%;
  text-align: center;
}
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
  #text-four,
  #text-four-p {
    display: none;
  }
}
<div class="row">

  <img src="image/4.jpg" class="img-responsive" id="big-image">


  <div class="col-sm-12">
    <div class="carousel-caption">
      <h3 id="text-four"> HOW TO WATCH SHORTSHD (US) OR SHORTSTV (EUROPE)</h3>
      <p id="text-four-p">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sit amet bibendum lorem. Nullam molestie lectus eros, vel ornare mi</p>
    </div>
    <div class="row">
      <div class="col-xs-12 col-sm-12 col-md-6">
        <div class="carousel-caption">
          <div class="US">
            <h2> ShortsHD (US)</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at lobortis diam. Nam quis mauris ipsum. Fusce ac felis pharetra, egestas ante ut, malesuada quam. Vestibulum id arcu eget ipsum semper vestibulum. Nullam vitae ipsum tellus.
              Aenean nec sem consequat, mattis dolor eu, eleifend lectus. Nam id purus hendrerit, lacinia massa a, ullamcorper massa. Cras eget risus ut nulla cursus vestibulum. Duis id tellus fringilla, ultricies est id, sagittis velit. Morbi quis ante
              pharetra, tincidunt neque non, ultricies diam. Cras ornare risus vel nisl gravida, non viverra lacus efficitur. Nam consectetur dolor eros, quis iaculis arcu accumsan at. Aenean vitae lectus eros.</p>
          </div>
        </div>
      </div>
      <div class="col-xs-12 col-sm-12 col-md-6 col-pull-6">
        <div class="carousel-caption">
          <div class="EU">
            <h2> ShortsTV (EU)</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at lobortis diam. Nam quis mauris ipsum. Fusce ac felis pharetra, egestas ante ut, malesuada quam. Vestibulum id arcu eget ipsum semper vestibulum. Nullam vitae ipsum tellus.
              Aenean nec sem consequat, mattis dolor eu, eleifend lectus. Nam id purus hendrerit, lacinia massa a, ullamcorper massa. Cras eget risus ut nulla cursus vestibulum. Duis id tellus fringilla, ultricies est id, sagittis velit. Morbi quis ante
              pharetra, tincidunt neque non, ultricies diam. Cras ornare risus vel nisl gravida, non viverra lacus efficitur. Nam consectetur dolor eros, quis iaculis arcu accumsan at. Aenean vitae lectus eros.</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

Answer №1

Adjust layout in media query

@media only screen 
     and (min-device-width : 320px) 
     and (max-device-width : 480px) {
    .US{
      position: relative;
      overflow:auto;
      bottom: 250%;
      left: 15%;
      text-align: center;
     }
     .EU{
     position: relative;
     overflow:auto;
     bottom: 250%;
     right: 15%;
     text-align: center;
     }
     }

Answer №2

Your main container contains multiple elements that have the position:absolute property applied to them.

This is causing them to overlap and share the same position on the page.

To fix this, create a parent container with position:absolute and then adjust the positioning of the child containers within it as needed.

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

Ways to display and conceal a div when hovering over another div

Currently, I have 4 divs grouped under the class "menubut." I am attempting to create a small overlay that appears when hovering over the menubut classes. Additionally, I want another div called "red" to show up about one-tenth of the size of the menubut ...

How can you achieve three layers of nested quotes in Dynamic HTML?

Working on an app that utilizes JQuery and JQTouch for iOS. The issue I'm facing involves dynamically generated HTML lists where the user clicks a row that needs to be highlighted. However, achieving this has proven tricky due to nesting 3 sets of quo ...

What is the best way to line up a checkbox and its labels alongside a dropdown menu?

My index.html file has a header like this: https://i.sstatic.net/s0hAt.png I'm trying to align the checkbox and its label with the dropdown menu "In ordine". I'm using only bootstrap (no custom classes) and my current page layout is as follows. ...

The art of spinning in CSS

Can anyone help me figure out how to make an animation in CSS stay at its last frame instead of reverting back to the beginning? The <i>animation-fill-mode: forwards;</i> property doesn't seem to be doing the trick. Is there a workaround ...

Step-by-step guide on building an engaging Donut chart using jQuery

After spending several hours working on it, I'm struggling to draw my donut graph with JavaScript. Can anyone provide a solution? I am looking for a way to add 25% when one checkbox is selected and +25% when two checkboxes are selected. Thank you in a ...

The CSS transition fails to function correctly when rendering a React element within an array

When rendering a React component within an array using CSS transitions, I noticed that the elements in the array re-order and change style. Surprisingly, only the elements moving up have transitions applied, while the ones moving down do not. I expect all ...

"Is it possible to keep an eye on two different events and take action once they both

I have a menu with different submenus for each list item, all utilizing the same background tag. Currently, when one submenu is open and I hover over another list item, the previous submenus hide and the new one opens. What I want is for the content to cha ...

How can I feature an image at the top of the page with large 3 and jQuery in FireFox?

I am interested in showcasing a single image at the forefront of the page when it is selected. While there are numerous plug-ins that offer this feature, many come with unnecessary extras like galleries, video support, and thumbnails which I do not requir ...

unable to retrieve the latest scope value following the completion of the ajax request

I attempted to use the code below, but despite searching for answers and solutions involving $apply and $timeout, nothing seemed to work in my case. I encountered several errors along the way. JS: var app = angular.module("test",[]) app.config(function($ ...

Even with the text field populated and clearly existing, Firefox is still throwing a null error when trying to retrieve it using

Hey there! I'm currently working on a sample HTML page and I'm facing an issue with retrieving data from a text field. No matter what I try, I keep encountering the following error: TypeError: document.getElementById(...) is null Let me share t ...

Dynamically created span element in script facing issues in MVC application

I have a single MVC project where, in the BusinessPosition.cshtml file, I am dynamically creating a tree view at runtime. By default, it displays the main child of the root node upon page load, like this: <ul class="col-lg-20 col-sm-12 col-xs-12" style ...

What is the best way to keep wp_nav_menu expanded while accessing submenu links?

Recently, I joined the Wordpress community and am currently in the process of converting a static HTML site to the WP platform. Almost everything is working smoothly except for the navigation menu. I am attempting to utilize the built-in navigation featur ...

Transfer the choices from a dropdown list to a different JSP page

In my current JSP code, I have a select element that looks like the following: <select name="withoutAccess" size="5"> <c:foreach var="item" items="${obj.withoutAccess}"> <option>${item}</option> </c:foreach> </sel ...

Column div being obscured by footer

My footer is causing overlap issues with the div above it on my mobile website. Here's a visual representation: Current view on my phone: https://i.stack.imgur.com/RpvWM.png Desired view: https://i.stack.imgur.com/KHVcm.png The code for the are ...

The Django template fails to implement CSS styling

I am trying to apply text-align: justify and reduce the text width on a Django template file, but it seems that my CSS isn't working for only this specific element. I have no idea how to solve this issue even though my static files and direction are f ...

Iterate over the array and eliminate any stylesheets

Currently working on a website using WordPress, and dealing with some unwanted css files that come with certain plugins. I've been attempting to remove these stylesheets with JavaScript but keep running into an error saying Failed to execute 'qu ...

jQuery Mobile Dialog Alert Box

Here's a code snippet that can be used to open a dialog box: <p><a href="ShopItems/Rotax125MicroMax.html" data-rel="dialog" data-role="button">Rotax 125 Micro Max</a></p> Next, we have a page whic ...

Using javascript, what is the best way to clear a text field with a specific condition?

When I clear the text field #t1, I expect text field #d1 to also clear. However, the last two lines of code do not achieve this result. function utl() { var tField = document.getElementById('t1'); var dField = document.getElementById(&a ...

Tips for making a slide-in animation that doesn't require adjusting the browser size

As I work on an animation where an img object and text slide in from outside the frame of the webpage upon page load, everything seems to be running smoothly. But there's one glaring issue: right at the start of the page load, the webpage resizes for ...

Issue with bootstrap-timepicker not functioning within ng-repeat loop

Check out the Plunker demo I have been experimenting with creating multiple instances of the timepicker. When I hardcode them, they function properly. However, once I attempt to put them into an ng-repeat, they stop working. Any suggestions on how to reso ...