Tips for creating a responsive container for mobile and smaller devices using Bootstrap 3

Apologies in advance for the lengthy post, but I welcome any suggestions and ideas. Thank you!

I'm facing an issue with my layout breaking when the screen size is below 1200px (images and text drop down). I don't mind if they stack vertically on smaller browsers, as long as each item is correctly positioned under the corresponding heading.

Heading 1
8:00am
Lorem ispum
Lorem ispum
Lorem ispum

8:30am
Lorem ispum
Lorem ispum
Lorem ispum

Heading 2
9:00am
Lorem ispum
Lorem ispum
Lorem isum

And so forth...

My question is, what would be the optimal way to make this layout work effectively on mobile devices and smaller screens? I've tried using Bootstrap's img-responsive class, but I haven't seen a noticeable change in the image - it's possible that I'm not using it correctly. I expected it to resize the image.

Additionally, in the provided screenshot, there are 3 headings with 4 associated times. What is the best approach to align each heading with its respective time slot (Heading 1 having two times)? Currently, the associated times of "Heading 2" and "Heading 3" seem slightly off to the left. I attempted adding padding/margin to adjust this, but it didn't resolve the issue.

<div class='tours-information'>
    <div class='container'>
      <div class='row'>
        <div class='col-md-9'>
          <div id='schedule'>
            <h2>Schedule</h2>
              <!--- wrapper for each day -->
              <div class='clearfix'>
                <h3 class='rounded-heading'>Main heading</h3>
              </div>
                  <div class="media">
                    <h5 class="media-heading pull-left ">Heading 1</h5>
                    <img class="media-object pull-left img-responsive" src="img/long_blue_arrow.png" alt="..." />
                    <h5 class="media-heading pull-left">Heading 2</h5>
                    <img class="media-object pull-left img-responsive" src="img/short_blue_arrow.png" alt="..." />
                    <h5 class="media-heading pull-left">Heading 3</h5>
                 </div>

                 <div class='schedule-location'>
                  <div class='col-md-3'>
                    <h4>8:00am</h4>
                    <div class='schedule-address'>
                      <address>
                      Lorem ispum<br>
                      Lorem ispum<br>
                      <span class='schedule-location-name'>(Lorem ispum)</span>
                    </address>
                   </div>
                 </div>
               </div>

                <div class='schedule-location'>
                  <div class='col-md-3'>
                    <h4>8:30am</h4>
                    <div class='schedule-address'>
                      <address>
                      Lorem ispum<br>
                      Lorem ispum<br>
                      <span class='schedule-location-name'>(Lorem ispum)</span>
                    </address>
                   </div>
                 </div>
               </div>

                <div class='schedule-location'>
                  <div class='col-md-3'>
                    <h4>9:00am</h4>
                    <div class='schedule-address'>
                      <address>
                      Lorem ispum<br>
                      Lorem ispum<br>
                      <span class='schedule-location-name'>(Lorem ispum)</span>
                    </address>
                   </div>
                 </div>
               </div>

                <div class='schedule-location'>
                  <div class='col-md-3'>
                    <h4>10:00am</h4>
                    <div class='schedule-address'>
                      <address>
                      Lorem ispum<br>
                      Lorem ispum<br>
                      <span class='schedule-location-name'>(Lorem ispum)</span>
                    </address>
                   </div>
                 </div>
               </div>

#schedule {
  background-color: #fff;
  float: left;
  padding: 2px 25px 25px;
}

#schedule img {
  margin-top: 3px;
}

#schedule h2 {
  font-size: 35px;
  margin-bottom: 0px;
}

#schedule h3 {
  font-size: 28px;
}

#schedule h4 {
  font-size: 30px;
}

.rounded-heading {
    display:block;
    clear:right;
    float:left;
    padding: 1.5%;
    width:auto;
    height:auto;
    border-radius:10%;
    -moz-border-radius:10%;
    -webkit-border-radius:10%;
    -khtml-border-radius: 10%;
    background:#eee;
    text-align:center;
}

Answer №1

Utilizing the row class is crucial for creating a responsive layout. Take a look at the Bootstrap documentation here http://getbootstrap.com/css/#grid and remember that you have the option to combine classes in order to customize your layout, especially on smaller devices.

For example, using

<div class="col-sm-6 col-lg-3">
will adjust your layout from 4 columns to 2 columns on devices with a width of ≥768px, and then to a single column on phones.

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

Execute a function every 10 seconds after it finishes running (JavaScript)

I am currently facing a challenge with a function that utilizes the "post" method to retrieve data from the server for processing. The amount of data retrieved varies, leading to longer completion times (around 30 seconds). My goal is to have this functi ...

Tips on preventing conflicts between jQuery FancyBox and mouse scrolling

<script src="js/jquery-1.9.1.js"></script> <?php include("fancybox/fb.php"); ?> <script type="text/javascript" src="js/jquery.slimscroll.js"></script> <script type="text/javascript"> ...

Implementing a Dynamic Navigation Feature using PHP in a Standalone File

I am currently working on creating a dynamic PHP navigation system that should highlight the active tab, but I'm facing challenges with making the active tab part function properly. While there are simpler methods available, they all involve incorpora ...

Collapsing one tab when another is selected in the accordion interface

I have successfully implemented an accordion feature, but I am facing an issue where the tabs do not close when another one is clicked. Currently, they only open but fail to close the previously opened tab... Below is the code snippet for reference: < ...

Dealing with jQuery Validation is driving me crazy!

Hey there, I've been struggling with JQuery validation problems lately and nothing seems to be working. I've tried starting from scratch multiple times but still can't figure it out. The latest attempt can be found using the reference link b ...

Apply the active class to only one element at a time

Presented here is a table showcasing available dates and times. Users can select a specific time by clicking on the "Choose" link. Currently, when a user selects a time, the class "active" is applied. However, the desired behavior is to remove the previous ...

What is the proper way to mention "a" within an unsorted list?

I currently have a div section with the following content: <ul id = "issues"> <li> <h1>title</h1> <p>text text text </p> <a class="next" href="#">next</a> </li> <li> <h1>title</h1> &l ...

Step-by-step guide to applying a CSS class to a grid cell using Syncfusion

Is there a way to define a specific style for a cell using the Syncfusion grid grouping control? I attempted the code below, but it doesn't seem to be effective in my webform. tdescriptor.Columns[0].Appearance.AnyRecordFieldCell.CssClass = "hideColum ...

Unable to modify SVG color to a white hue

I am currently working on an Angular project where I am utilizing SVG to display some icons. These icons originally have a default grey color, but I want them to change to white when hovered over. Interestingly, while changing the color to red, green, or y ...

Encountering challenges while integrating Angular with a Laravel forum creation project

Currently, I am working on building a forum application that involves users, posts, and comments using Laravel. However, the next step in my project requires integrating Angular, which is new territory for me and I'm not sure where to start. I have a ...

Can you tell me where the templates store their icons?

Hey there, thank you for taking the time to read my question. I have a template that can be found at this link: In the top left corner of the template, there is an icon of a home. I have copied the entire website, including images, css, and js files, but ...

In the realm of asp.net mvc, JSON remains a mysterious and undefined

When working with ASP.NET MVC 3, I have encountered an issue regarding JSON in my AJAX calls. The application runs smoothly on my development machine when using Visual Studio. However, after publishing the same application and trying to access it through a ...

The retrieval of JSON file using $.GetJson() is unsuccessful from local directory

There is a basic autocomplete program in place. The data entered in the textbox is successfully captured while debugging, however, the GetJson() function fails to retrieve the JSON file, causing the program to malfunction. Here's the relevant code sn ...

Resize images smoothly without disrupting the anchor scrolling

I have created a website with the following design: (Caution: The site is built using AngularJS on a server that may not serve it correctly - please visit directly instead of using browser reload.) However, I am facing two conflicting requirements... ...

How to Create a DataTable Responsive Feature Where All Columns Collapse on Click, Except the Last One?

I am currently utilizing the DataTables library to generate a responsive table. I am aiming to create a feature where all columns in the DataTable can toggle between collapse and expand states when clicked, with the exception of the last column. Below is a ...

What is the best way to eliminate the border in IE edge that surrounds special characters?

Here is the current appearance of the cross button in IE/Edge: https://i.sstatic.net/JZ37V.png And here is how it is supposed to look: https://i.sstatic.net/Uqafg.png Upon inspecting the CSS, it reveals that the #10006 html character has a color code o ...

Challenges with TinyMCE and Drag Interaction

Here's the issue I'm facing with my page. The problem arises when using draggabilly to move the line. Dragging it to the left works fine, but dragging it to the right doesn't function properly in the area where the tinymce compiler is locat ...

Dynamic SVG circles with timer and progress animation

Is there a way to modify the following: var el = document.getElementById('graph'); // get canvas var options = { percent: el.getAttribute('data-percent') || 25, size: el.getAttribute('data-size') || 220, lineW ...

Is there a way to regularly extract the most up-to-date HTML code from a dynamic website for designers to work

Our team of designers is responsible for creating graphical mockups, initial html, css, and image sprites for new designs. They also maintain these files. Once the hand-off is complete, our developers then take everything and work it into .Net code, templa ...

What strategies can be implemented to minimize the use of if-else statements?

Is there a more efficient way to simplify this if-else statement? This code dynamically changes the picture based on integers retrieved from the database. I am looking for ways to optimize this code. if (val["soil_h"] < 21){ $("#ground").att ...