I'm currently working on setting up a gallery on the lower part of my webpage, but for some reason, the lightbox2 images are not aligning next to each other in rows. Can anyone

Struggling to align images in a gallery at the bottom of my webpage. They keep appearing on separate lines instead of next to each other.

HTML:

    <section id="galleries">
        <h2>Galleries</h2>    
        <article class="img-item">
            <figure>
                <a href="/images/martin/Photo24_21.jpg" rel="lightbox" >
                    <span class="thumb-screen"></span>
                    <img src="/images/martin/Photo24_21.jpg" alt="Martin"/>
                </a>
            </figure>
        </article>
        <article class="img-item">
            <figure>
                <a href="/images/martin/Photo26_23.jpg" rel="lightbox" >
                    <span class="thumb-screen"></span>
                    <img src="/images/martin/Photo26_23.jpg" alt="Martin"/>
                </a>
            </figure>
        </article>
        <article class="img-item">
            <figure>  
                <a href="/images/martin/PICT0647.JPG" rel="lightbox" >
                    <span class="thumb-screen"></span>
                    <img src="/images/martin/PICT0647.JPG" alt="Martin"/>
                </a>
            </figure>
        </article>
      </section

CSS:

#galleries, #main-content
{
        line-height:25px;
        clear:both;
        width:auto;
        max-width:900px;
        margin:0 auto;
}

#galleries h2, #main-content h3
{
        border-bottom: 1px solid #D6D0C1;
        margin-bottom: 20px;
}

#galleries .img-item
{
        float:left;
        margin-right:25px;
}

#galleries .img-item a
{
        position:relative;
        display:block;
}

Looking for assistance to resolve this issue. It's strange because on one of my pages the images appear correctly?

Answer №1

Upon reviewing the CSS code on your website, I have implemented some changes to enhance the layout of your images according to your preferences.

Below are the CSS modifications:

/*Adjustment: Resolves issue with lightbox images not being displayed side by side */

/*removed .img-item img , as it was setting all child elements of #galleries to 40% width*/
#galleries 
{
    /*increased width from 40% to 60% for a more visually appealing aspect ratio*/
    width: 60%;
}

.img-item{

    /*Defined width for the image item containers*/
    width:25%;
}


.img-item img{

/*ensures that the image does not exceed its container's size*/
max-width:100%;

/*Added height to prevent smaller images from stacking atop one another at the end of the container*/
height:200px;
}

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

Extracting information from JSON using arrays

I'm facing a bit of a challenge with this one. I've been trying to use jQuery on my website to update an element. It works perfectly fine without using an array of data in JSON, but as soon as I introduce an array of data, it stops functioning. I ...

Issue with flex item not expanding to fill entire height within flex container

My markup contains the following code: .container { display: flex; width: 500px; } .col1 { background: red; height: 100%; width: 50px; } .col2 { background: blue; flex: 1; height: 200px; } <div class="container"> <div class= ...

Tapestry creates the shape attribute for the <a> element

Currently, I am working with Tapestry 5.2.6 and I am attempting to remove the shape attributes on anchor tags. The tag generated by Tapestry appears like this: <a shape="rect"...> I have searched online without any luck, so if you have any insight ...

I am facing the issue of only one ajax script functioning properly even though I have

I have encountered a confusing issue with two loadmore scripts that are triggered by different buttons. The problem is that when I click the second button, it loads the content that should actually be loaded by the first button. The first button, however, ...

Upon submission, the form is processed and 'false' is returned

Does anyone know how I can use ajax to save form data? I am encountering an issue where the page refreshes when all entries are correct. If I input any incorrect data and submit, it displays an error. However, if I then fill in all correct information, it ...

When clicking, populate the content of another div in a vertical top-to-bottom fashion

I am in the process of creating a functionality where clicking on one element will fill another element's content from bottom to top. Although I have managed to make it work on hover, the same functionality is not triggered when clicking on the eleme ...

How can we alert users when data has been updated without the need for a page

The following code was authored by me: $('.actionButton').click(function(){ var buttonValue = $(this).val(); var userId = '<?php echo $_SESSION['id']; ?>'; console.log(userId); ...

Tips for revealing a hidden HTML tag

I am currently trying to validate the content within #textd to ensure it is not empty and contains more than 150 characters. If it meets these conditions, I need to transfer the content to another webpage; otherwise, display an error message based on the c ...

Do you want to reset the validation for the paper input?

I am encountering an issue with a paper-input element in my code. Here is what it looks like: <paper-input id="inputForValidation" required label="this input is manually validated" pattern="[a-zA-Z]*" error-message="letters only!"></paper-input&g ...

Moving a file from one webpage to another

My current project involves creating a multi-page form consisting of 3 pages. The first page will collect user input, including an uploaded file. The second page will display a summary of the entered data for confirmation. The third page will handle submit ...

List the @font-face URLs using JavaScript or jQuery

Can JavaScript or JQuery be used to list all the @font-face URLs (web font URLs) on a specific HTML page? ...

"Crafting a sleek card design using Material UI components in React JS

Exploring the world of material UI and looking to create a card with an image and footer. However, I'm facing challenges as there is no default option for adding a footer in the card. https://i.stack.imgur.com/xlxyb.png I want the image to be center ...

Upgrade ngf-select to work with Angular 8 versions

Currently in the process of transitioning from AngularJS to Angular 8. Looking for guidance on how to update the following code snippet for Angular 8: <button class="other-button contactUsSpecific" type="button" (change)="contactCtrl.uploadFile ...

Issue with jQuery - Exchanging positions of two elements fails after the initial swap

I'm currently using a function to perform a bubble sort on the content of multiple div elements. During each swap operation, it swaps the divs as well by utilizing the JQuery Swapsies plugin. The issue I’m facing is that after the initial swap, subs ...

What is the correct method to define the width as a percentage while also maintaining a minimum width in pixels?

My header/navigation bar div features a repeat-x background image. Within this, I have a horizontal navigation that needs to be centered over the background with a specified min-width and normal width. I want the navigation to be 80% of the full width, wi ...

Finding HTML tag with a particular attribute in Swift

Is there a way to extract specific attribute tags from an HTML link? Currently, I am using the following code to retrieve the page content using SwiftSoup: // Checking if MyLink is working guard let myURL = URL(string: MyLink) else { ...

Issue with AngularJS controller method not functioning properly when assigned to a Div

I am facing an issue with a login form and its controller. The login function is not triggering upon submitting the form for some reason. Here is the code snippet for the form within the larger view file: <div class="login-wrap" ng-controller="LoginCt ...

Is your Jquery Popup Overlay flashing when the page loads?

I am currently utilizing the JQuery Popup Overlay in one of my applications. It is functioning well, but there seems to be an issue. Upon page load, it flickers and then disappears. Despite my efforts, I have been unable to pinpoint the cause. Could you pl ...

Ways to prevent the remaining time from indicating the duration

Welcome to my website. If you have any tips on creating dropdowns in markdown, please share! Here is the code snippet: // Add your JavaScript code here This script is designed to play music from a file. To use it, simply click the play button and upload a ...

One cannot adjust the opacity of the arrow in ionic 4 ion-item details

Currently, I am dealing with a project that was not originally coded by me and have come across an issue that is proving to be challenging to resolve. Please review the code snippet below: <ion-item detail *ngIf="c.cv" [routerLink]="[&ap ...