Responsive images causing Bootstrap Div to become unscrollable

I'm having trouble setting up a gallery section using bootstrap. The scrollspy feature doesn't seem to be creating a scrollable area for the images. Instead, the images are overlapping the borders and running all the way to the bottom of the page.

    <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title></title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/gallery.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>

        <div class="container-fluid" id="container-fluid">
            <div class="container">

                <nav class="navbar navbar-default">
                  <div class="container-fluid">
                    <div class="navbar-header">
                      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span> 
                      </button>
                      <a href="home-page.html" class="navbar-left" id="nav-brand"><img src="images/sugar-logo.png" style="width:100%;height:100%;"></a>
                    </div>
                    <div class="collapse navbar-collapse" id="myNavbar">
                      <ul class="nav navbar-nav">

                        <li ><a href="home-page.html">Home</a></li>
                        <li ><a href="experience.html">Experience</a></li>
                        <li class="active"><a href="#">Gallery</a></li>
                      </ul>
                      <ul class="nav navbar-nav navbar-right">
                        <li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
                        <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>

                      </ul>
                    </div>
                  </div>
                </nav>

                <div class="row" id="content" >
                    <div class="col-md-4" id="text">
                        <h3>What to Expect</h3>
                    </div>
                    <div class="col-md-8" id="slides" data-spy="scroll" data-offset="0" >           
                        <div class="col-md-4">
                             <img src="images/01.jpg" class="img-responsive" alt="" width="100%" height="100%">
                        </div>
                        <div class="col-md-4">
                             <img src="images/02.jpg" class="img-responsive" alt="" width="100%" height="100%">
                        </div>
                        <div class="col-md-4">
                             <img src="images/03.jpg" class="img-responsive" alt="" width="100%" height="100%">
                        </div>
                        <div class="col-md-4">
                             <img src="images/04.jpg" class="img-responsive" alt="" width="100%" height="100%">
                        </div>
                        <!-- More image divs here -->
                    </div>
                </div>
            </div>
        </div>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>

CSS Code

body{
    padding: 0px;
    margin: 0px;
}
#container-fluid{
    background-image: url("background/bground-main.png");
    background-position: cover;
    z-index: -1;
}
.container{
    width: 80%;
    margin-top: 50px;
    margin-bottom: 100px;
    background-color: white;
    border-radius: 25px;
    border: 2px solid white;
    padding: 20px; 
    height:auto;
    background-color: #e6e6e6;
}
#nav-brand{
    width: auto;
    height: 80px;
}
.navbar-default {
  background-color: #bfdcf2;
  border-color: #000000;
}
<!-- More CSS styling properties here -->

Looking for some help with this issue.

Answer №1

To fix the issue, you can simply include the CSS style overflow: auto; within the #slides element. For more information on this property, visit here

The overflow property controls how content is handled when it exceeds the size of its container, whether to clip it, show scrollbars, or hide it.

Additionally, consider applying the style overflow: hidden; to the .container class for a seamless user experience.

Answer №2

If you want to enable scrolling, try applying the property overflow:scroll;

To learn more, take a look at this resource

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

Refresh Form (Reactive Forms)

This is the HTML code snippet: <div class="container"> <ng-template [ngIf]="userIsAuthenticated"> <form [formGroup]='form' name="test"> <div class="form-group"> <input type="text" class="form-contr ...

Tips for designing a CSS border that remains consistent in size throughout

I'm trying to figure out how to adjust my code so that the border surrounding my text stays in position and changes size when I input longer text. Here is the code I'm currently working with: <h1 id="result" style="color:black; font-family: B ...

Updating user schema in Angular to include question_id in list of bookmarks

Schema: var UserSchema = new Schema({ ques_bookmarks: [{ type: String }], }) Controller: .controller('questionsController', function(questionsFactory, $routeParams, $scope) { var that = this; questionid = $routeParams.id; stats = fal ...

Tips for animating the box-shadow effect using jQuery

Can anyone provide insight on how to animate the box-shadow of multiple elements? I have reviewed previous threads such as this one, but found outdated and non-working solutions. Additionally, I came across the jquery box-animation plugin, which is limit ...

Creating a string of DIV elements with PHP and mySQL - is it possible?

I am in the process of creating a well-formatted product list using data from an SQL database. The goal is to have my website display a store layout with small boxes containing brief information about each product that, when clicked, will open up detailed ...

"Encountering issues with updating the .css file while debugging in ASP.NET MVC 2, changes

I've been working on an MVC 2 Project and ran into an issue. I made changes to the attributes of an id in the Site.css file, specifically changing the color from White to Red. However, when I run the application, the changes are not reflected on the v ...

Issues arise when attempting to animate letters using jQuery and CSS

My goal is to create a dynamic animation effect on a string when a user hovers over it. This involves turning the string into an array and applying different animations to each letter. Although the animations are working perfectly, I'm facing one issu ...

Personalizing Material-UI Components using Styled-Components

My attempt to modify the props of a material-ui Grid component using styled-components was not successful. I initially tried: const NavGrid = styled(Grid)` direction: 'row'; ` Unfortunately, this approach did not yield the desired result. T ...

Retrieve HTML content from Vuetify components without displaying it on the webpage

I have a project where I need to retrieve the HTML code from various Vuetify components. Instead of just as a HTML string, I actually need it as a DOM element that can be easily added to the body. This is necessary for me to be able to utilize these compon ...

Transforming data from PHP JSON format into HTML output

Struggling to convert JSON data into HTML format? Having trouble maintaining the correct order of child elements in your structure? Here's a solution: Take a look at this example JSON: { "tag": "html", "children": [ { "ta ...

Adjust the div height to 100% in Bootstrap to center text, even with the presence of a navbar

I'm currently using Bootstrap 5 and facing an issue with getting text centered vertically on the page. I attempted to make the container of the div take up 100% of the page by using h-100, but it resulted in overflow due to the navbar occupying some s ...

Using AngularJS to update attributes in an HTML tag within a string

My string contains HTML tags : var str = "<div><p></p><p><i>blabla</i></p><p><i><b>blaaaaaablaaaaa</b></i></p><iframe src='urlAAA' height='400' width=&ap ...

MD-List Equilibrium Elevation

Seeking a solution for implementing a simple chat using the md-list template. The issue arises when new items are added to the md-list, causing it to expand. Desiring the list to behave similarly to other chat platforms, where the height remains constant ...

Comparison between Bootstrap 4 and Firefox Preload Error

Hello fellow front end developers who are experiencing an issue with CSS preload in Firefox versions above 74.0. I have encountered a problem with the following code snippet: <link rel='preload' as='style' onload="this.onload=null; ...

Are the CSS flow arrows suffering from poor formatting?

https://i.sstatic.net/ni3vf.pngAfter tinkering with code from three different individuals to create CSS arrows, I fear I may have overcomplicated things. Is there any CSS expert out there who can help me streamline this? I'm struggling to adjust the p ...

Revolutionary CSS and jQuery for an Exceptional Top Navigation Experience

I would like to create a top navigation similar to the one on Facebook, using CSS and jQuery. Here is an example: Additionally: Notice how the arrow in the popbox always remains beneath the selected navigation item, and all popboxes have the same width. ...

The Javascript script is malfunctioning

Is there a way to modify the code so that the second drop-down menu becomes editable when an option is selected from the first drop down menu? The second drop-down menu should remain read-only if no option is selected, and specifically if "default" is ch ...

Retrieve the form identification in jQuery Mobile on the 'pageshow' event

Is there a way to retrieve the form ID of the current page using 'pageshow' in jQuery Mobile? I am currently able to obtain the ID of the active page by following this method. $(document).on('pageshow', function () { var id = $.mobile. ...

Invisible Thinglink image revealed upon resizing browser

I am currently repurposing a pre-existing theme that has a drop-down menu showcasing an image. I am attempting to integrate a Thinglink into the content section of this drop-down, but unfortunately, the image does not appear until I adjust the size of the ...

Retrieve the folder name after selecting the folder in the input field

I have used the code snippet below to select a folder and parse all the files within that folder. While I am able to retrieve a list of all files, I am unsure how to extract the folder name alone from the path. For example, if the folder path is C:/Folder ...