Premature adjustment of images to window size changes

How can I make the images inside a divider move down when the right-end of the browser reaches them? Currently, they start moving down before the edge of the window is reached. Any suggestions on how to fix this?

JSFIDDLE: https://jsfiddle.net/prtdaay1/2/

CSS:

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
ol, ul {
    list-style: none;
}
html {
    background-color: #FFFFFF;
    -webkit-font-smoothing: antialiased;
}
body {
    background-color: #ffffff;
    font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5em;
    color: #545454;
    background-color: #ffffff;
    text-align: center;
    max-width:1600px; 
    overflow: hidden;
    overflow-y: scroll;
}
h1, h2, h3, h4, h5, h6 {
    color: #222;
    font-weight: 600;
    line-height: 1.3em;
}
h2 {
    margin-top: 1.3em;
}
.custom-class {
    text-align: right;
    margin-top:-130px;
    margin-right: 20px;
}
a {
    color: #000000;
    text-decoration: none;
}
b, strong {
    font-weight: 600;
}
samp {
    display: none;
}
img {
    -webkit-animation: colorize 2s cubic-bezier(0, 0, .78, .36) 1;
    animation: colorize 2s cubic-bezier(0, 0, .78, .36) 1;
    background: transparent;
    border-style:none;
    border-radius: 4px;
    display: block;
    margin: 1.3em auto;
    max-width: 95%;
}
.logo {
    text-align: center;
    margin-top:40px;
}
li {
    list-style-type: none;
    font-size: 1.5em;
    padding-top: 8px;
    text-align:center;
    border-style: none;
}

...

.hidden {
    display: none;
}

Answer №1

Make improvements to the styling of these identifiers

#second {
    height: 220px;
    margin: -215px auto auto;
    padding-left: 170px;
    width: 50%;
    }


#third {
   display: none;
   height: 220px;
   margin: -215px auto auto;
   padding-left: 150px;
   width: 50%;
   }

Instead of using padding, consider using max-width and utilize margin: auto for center alignment.

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

Is it possible to simulate a 'click' on the pageAction button within a Chrome extension using programming?

I created a Chrome extension that includes a pageAction button. When the user clicks on this button, a popup.html window appears for them to take action. Is there a method to style a link on the page in a way that when clicked, it automatically triggers a ...

Adding CSS and JavaScript files to HTML files within a Spring MVC 4 application

I'm encountering issues when trying to import my CSS files using spring 4 Initially, I attempted the following in index.html: <link href="../../resources/css/bootstrap.min.css" rel="stylesheet"> Although Eclipse did not detect any errors, th ...

Is it possible for the Observable call in Angular 4 to function similarly to jQuery's synchronous AJAX method?

As I have a business logic function that needs to use HttpGet and I must wait for the result before continuing, jQuery's ajax can handle this easily. But I am curious if Observables have a similar feature? I was hoping for the result to be: John An ...

Is there a way to update a field or submit a form without having to redirect or refresh the page?

I am struggling to find the right solution for updating just one field in my database called Flag, which is a Boolean field. I have tried using ajax/JQuery, but it only works for the first item in the list and stops working for subsequent items. The ID and ...

Leveraging jQuery to automatically fill in a time field while excluding other buttons

I've been working on using jQuery to automatically fill in a time input field. The functionality is working properly, but the time is also being applied to my other button. How can I make sure it only gets assigned to the time input field? I would re ...

What could be the reason behind the occurrence of an invalid hook error when utilizing an imported function

I'm currently working on creating a navigation bar for a dashboard page, but I've run into an issue. Everything works fine until I try to integrate the navbar by importing and executing the function. I can pinpoint that the problem occurs when in ...

Retrieve Browser Screen Width and Height using MVC3 Razor in the View

I am facing a challenge on my website where I need to generate a Bitmap dynamically and ensure it is rendered according to the width and height of the browser so that there are no overflow issues on the page. Although I have successfully created an image ...

Ways to stop custom Mailchimp form from redirecting upon submission

I have integrated a custom Mailchimp signup form into a webpage I am developing. The form works well, but I would prefer to avoid the automatic redirect to a new tab upon submission, which displays a confirmation message from Mailchimp about joining the ma ...

The issue of a non-firing Ajax click event in a JavaScript file

I have set up a table in JSP and am attempting to trigger a function when clicking on the table rows to post the data. I created a JavaScript file with an ajax click event, but unfortunately, the event is not being fired. $(document).ready(function( ...

Discovering the magic of nesting maps in React-Native without the need for

I am currently developing a react-native app that retrieves its data through an API. I am working on implementing a new feature where the information is grouped by date. The JSON data structure sent by the API looks like this: { "channel_count" ...

Having trouble with HTML code displaying correctly in R leaflet for labels instead of popups

While working with leaflet in R Studio, I encountered an issue when trying to add HTML code to the labels of the icons. Strangely enough, it works for the popups but not for the labels. Below is the code snippet causing the problem: library(leaflet) libr ...

Tips for making WebDriver pause until Sencha AJAX request finishes

While testing a page with Selenium WebDriver, I encountered an issue related to the Sencha JavaScript library being used on the underlying page. The problem arises when I input a value into a field and an AJAX call is made to validate that field. If the va ...

What steps should be taken to properly assess an AngularJS provider setup?

My provider definition looks like this: (function(angular) { angular.module('myModule', []) .provider('myService', function () { var service = {}; service.configureSomething = function () { }; service.$get = function () { ...

Is the value of a field still accessible after it has been hidden using jQuery?

Hey there! I'm currently using jQuery('').hide() to conceal a field in one of my applications. I have a question: If the hide function is used, can we still access the value within the hidden field? The purpose of my code is to extract the v ...

CSS - When using both display: flex and position: absolute, the anchor point is shifted

I have a flexbox element with three children. I want the second child to overlap the first child using absolute positioning, like this: Desired Outcome: https://i.stack.imgur.com/i479w.png It's important that the second child appears on top of the ...

AddThis plugin in Wordpress is unresponsive when used with a theme that relies heavily

I've been struggling to properly set up the AddThis Wordpress plugin to display share buttons below each post in an AJAX theme. After inserting this code into the custom button field on the settings page: <div class="addthis_toolbox addthis_defa ...

Can a radio button set be designed in two dimensions?

There are three sets of data (dataX, dataY, dataZ) that need to be assigned unique values out of a selection of three options (valueA, valueB, valueC). Each piece of data should be linked to one value and each value should have only one data associated wit ...

"Before saving a new row in jqGrid, make sure to trigger

I have a jqGrid where I'm encountering an issue when adding a new row that the user can edit. After they click a button to save the new row, I need to include some security in the AJAX call by accessing the beforeSend function. This has worked in othe ...

Utilizing Ajax functionality with Bootstrap framework

While working on a CMS with Bootstrap theming, I encountered an issue with Ajax integration. My login module functions properly with Ajax, but including the Ajax libraries causes my dropdown menu to malfunction. <script src="https://ajax.googleapis.com ...

Deleting a row from a Material UI table: Step-by-step guide

I'm currently working on a CRUD table using React and Material-UI. I have successfully fetched data from an API and displayed it in a table, but now I am facing a challenge with deleting a row. As this is my first project in React, I am seeking guidan ...