Tips for creating a responsive and centered scrollable horizontal gallery in Bootstrap, starting with the first of three images

Currently working on my portfolio and have incorporated a horizontally scrolling gallery featuring 3 macbook screenshots of my personal projects. My bootstrap skills are still developing, so any assistance would be greatly appreciated.

Primarily, I am aiming to center the scrolling on the initial image within the gallery. Could use guidance on how to achieve this as the edge of the second image always remains visible.

Additionally, looking to ensure the gallery remains responsive while continuing to center on the primary project picture. Any advice on how to accomplish this would be beneficial.

On a side note, I intend to create a modal for each image containing relevant case study material for every project.

Thank you in advance!

HTML

 <!-- Work Section -->
<section id="work" class="container content-section text-center">
<div class="container">
    <div class="row">
        <div class="gallery horizontal-gallery">
            <img class="work-modals" src="http://madebymunsters.github.io/Lannister/img/blocitoff.png">
            <img class="work-modals" src="http://madebymunsters.github.io/Lannister/img/blocitoff.png">
            <img class="work-modals" src="http://madebymunsters.github.io/Lannister/img/blocitoff.png">
        </div>                    
    </div>
</div>

CSS

.gallery {
    width: 100%;
    white-space: nowrap;
    overflow-x: scroll;
    overflow-y: hidden;
}

.gallery .horizontal-gallery {
    display: inline;
} 

http://www.bootply.com/QJ16EUgEVf

Answer №1

Check out this link for a solution: http://www.bootply.com/TVthEnxmzd

To achieve the desired layout, enclose each image in a div element and style it with 100% width and display:inline-block;

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

Utilizing fab-icons with CDN in Next.js version 13.4

Currently, I am working with the latest version of Next.js (13.4) and I would like to incorporate a single Icon into my project using Font Awesome CDN to avoid increasing the overall app size. However, when I include the following code snippet in my layou ...

Arranging two divs to appear side by side, but they are mysteriously aligning in a diagonal pattern

I'm facing an issue with my navbar's divs not displaying side by side when set to display inline. Here is the HTML code snippet: <!--Nav starts here--> <nav class="navbar"> <div class="navbar-item-set"> ...

Looking for assistance with HTML/CSS code

Adding the code snippet below into my Shopify product-liquid file caused chaos on the page, altering the font and even changing the shape of the add to cart button... The problematic code is shown below: <div id="shopify-section-product-icon-gallery" ...

Implementing a Tri-state Checkbox in AngularJS

I've come across various discussions on implementing a 3-state checkbox with a directive or using CSS tricks (such as setting 'indeterminate=true' which doesn't seem to work). However, I'm curious if there's another method to ...

Changing up the content within a jQuery class

I have 10 <p> tags in my HTML with the class of .rule I am looking to update the text for each of them independently without resorting to individual IDs like #rule1, #rule2, #rule3: $('.rule').eq(0).text('Rule 1') $('.rule& ...

Click on the event to save the document and print the HTML page

Is there a way to create an onclick event that saves the current HTML page as a document and then prints it? <html> <body> <div class="reportformat"> <div class="format1"> <table> <tr ...

Utilizing jQuery to add a class to an element when a different one is hovered above

I'm currently working on implementing effects on the edges of a webpage that will be triggered when a central div is hovered over. The main tool I'm using for this task is jQuery. Despite my efforts to diagnose the issue by using alerts in my Ja ...

Responsive Text and Alignment in the Latest Bootstrap 5

My goal is to center my div element while keeping the text aligned to the left. Here's the code I have: <div class="container"> <div class="row"> <div class="col"> <h1>< ...

Creating CSS with rounded borders, precise sizing, cleverly placed white space, and smooth anti-

After experimenting with a simple css scenario for creating a card style layout, I noticed that it looks fine on my 22-inch monitor but appears distorted on my Samsung TV with a resolution of 1920x1080. There seems to be a white gap in the border due to an ...

Attempting to make Navbar vanish as the page size decreases

I am a beginner in html and css and my instructor wants us to create a resume using bootstrap. Bootstrap is designed to provide interactive design that adjusts seamlessly across different devices. I am currently working on aligning elements and I would lik ...

Is the in-app browser of WeChat able to support self-signed HTTPS URLs?

My local WAMP server hosts a web application with self-signed SSL enabled, resulting in the following app URL: https://myipaddress:port/demoapp/index.html However, when I send this URL via WeChat chat and click on it, only a blank page is displayed. Stra ...

Struggling with CSS on your website and need some help?

Working on a website project with my own design, I ran into an issue regarding the positioning of the menu style. Describing this problem can be challenging, so let's start by looking at some images. What it should look like: https://i.sstatic.net/ ...

Conceal dynamically generated divs based on their individual class identifiers

My task involves dynamically generating div elements with incremented class names. Each div contains a close button in the top right corner, and I need to hide a specific div when the close button is clicked. Example Code: var i=1; var newImageBoxdiv = $ ...

Refresh the dropdown menu selection to the default option

My HTML dropdown menu includes a default option along with dynamically generated options using ng-options. The variable dropdown is bound to the dynamic options, not the default one. <td> <select ng-model="dropdown" ng-options="item as item.n ...

Mapping with Star Components

As a newcomer to ReactJs, my task is to create a 5-star review component with the ability to display half-star ratings. I previously implemented this in Angular5. Within the map method, I need to loop through the following elements: <!-- full star -- ...

Creating custom components in React

At times, I find myself in need of a special UI component such as a multiple range slider. However, I have a preference for not relying on third-party libraries, so I usually opt to create the component myself. As time has passed, I have completely stopped ...

Directives and Transclusion: A Comprehensive Guide

I am currently working on creating navigation directives to simplify complexity. My goal is to have the following HTML structure for my navigation: <custom-nav> <nav-item>Item 1</nav-item> <nav-item>Item 2</nav-item> ...

Guide on submitting a reply to Harvard's "Guess my Word" challenge using JSoup

I am currently working on developing a bot to enhance my gameplay in Harvard's intriguing "Guess my Word!" game. After some exploration, I found out about a post request feature available through Chrome's "inspect element" functionality when a pl ...

Rotating the camera in Three.js using touch controls and device orientation

Currently, I am working on a 3D project using three.js where I want to enable camera control with mouse for computers and touch events/device orientation for smartphones. A good reference for this is this website. On the PC version, I have successfully imp ...

What could be the issue with my dropdown navigation bar?

Currently in the process of learning CSS and HTML, I wanted to create a basic dropdown menu using CSS exclusively. However, there are some aspects that are unclear to me, so I would appreciate any assistance in figuring out what is happening. Here is how ...