The alignment issue arises when the browser is resized

Something seems off with my images. They appear correctly when I first open the browser, but if I resize it, they go all wonky. Refreshing the page fixes it, but if I open a larger browser window and then make it smaller, it messes up again. It's puzzling because the browser size remains the same when I refresh the page.

Can someone help me figure out what's causing this issue?

Here is the code I'm using:

<section class="bordo">
        <div class="abt3">
            <a href="https://www.facebook.com/media/set/?set=a.1482686551971696.1073741836.1450873611819657&type=3" target="_blank"><img src="fb.png" onmouseover="this.src='fbgrey.png'" onmouseout="this.src='fb.png'" width="10%" id="face"></a>

            <a href="https://www.flickr.com/photos/105943617@N06/" target="_blank"><img src="flik.png" onmouseover="this.src='flikgrey.png'" onmouseout="this.src='flik.png'" width="10%" id="flikr"></a>

            <a href="https://500px.com/owlyac" target="_blank"><img src="500.png" onmouseover="this.src='500grey.png'" onmouseout="this.src='500.png'" width="10%" id="gram"></a>
        </div>
    </section>

And the css:

#face {
padding-left: 30%;
padding-right: 2.5%; 
}

#flikr {
padding-right: 2.5%;
padding-left: 2.5%;
}

#gram {
padding-right: 25%;
padding-left: 2.5%;
}

You can view the issue here: Try resizing the window to reproduce the problem.

Thank you!

Answer №1

Ensure that the div containing the icons has a percentage width.

Additionally, consider giving the images a position of absolute if the first suggestion does not resolve the issue.

The design looks great and functions well.

Viewing on an iPhone, the layout appears correct, which is why I am not including any code.

For clarification on the first point, wrap the three images in a div and set a percentage width of your choice. If the problem persists, add a position of absolute to both the container and icons.

I mentioned Bootstrap because media queries can help manage this behavior effectively.

Answer №2

It appears that you may be tweaking the percentages in the (padding & width) of your icons and the "abt3" div. To simplify things, you can eliminate all padding from #face, #flick, #gram. The "abt3" div already has text-align:center applied, so it will handle the centering. For spacing between icons, you can utilize margin-right:10px.

#face, #flick{
  margin-right:10px
  }

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

React random marker position shifts when the screen size is adjusted

After displaying an image and adding a marker to it, I noticed that the marker's position changes when the screen size is adjusted. Why does this happen? And more importantly, how can I ensure that the marker stays in the same position relative to the ...

Frame Tweet Integration

Attempting to create an iframe modal with a Twitter share source. <iframe src="https://twitter.com/share" class="tweetFrame"></iframe> The current setup is not functioning properly, resulting in a blank page. Is there a workaround to ensure t ...

Import a pygame surface into tkinter to display an image using Python 3

I'm attempting to display an image in tkinter from a pygame surface, but I've encountered a problem. Here's the code snippet I'm currently using: image_data = pygame.image.tostring(surface, 'RGB') tk_image = tkinter.PhotoIma ...

The correct usage of && and || operators in javascript

I've developed a small web application and I'm facing an issue where I want to trigger an alert when the 'enter' key is pressed if there is an empty or space value. Currently, the alert appears not only on hitting 'enter' but ...

What is the best way to conceal a dropdown menu when the page first loads?

I have a dropdown menu that is displaying like this: <ul> <li class="dropdown open"> <a aria-expanded="true" href="#" class="dropdown-toggle waves-effect waves-button waves-classic" data-toggle="dropdown"> <spa ...

Splitting a row into four columns that will appear consistent on mobile devices

Is it possible to create a row with 4 columns in Angular 6, but have it display as 2 rows with 2 columns each on mobile devices? <div class="row" id="info" *ngIf="this.details"> <div class="col-md-12 mb-3" id="heading"> <h3>Meeting ...

Ways to differentiate between buttons in a button cluster?

I have created a set of 3 buttons using the code from this resource. However, the buttons are currently positioned vertically close to each other as shown in the source code. I would like to adjust the spacing between them. Is there a way to achieve this ...

Tips for positioning a label at the top of a table row in an asp.net C# application

I am facing an alignment issue in my asp.net page with a table that contains a label and a textbox. Despite trying various methods, the label consistently displays at the bottom of the row. How can I ensure that the label is aligned to either the center or ...

What is the best way to horizontally align divs with CSS?

I have been using a combination of table and CSS to center divs on my page. Here is the code I'm currently using: <table width="69" border="0" align="center"> <tr> <td width="59"> <div style="position:relative;"> ...

Angular template src variable issue with no solution in sight

The videoSrc variable is not evaluating correctly images/{{videoSrc}}.mp4 When I write just videoSrc, it works fine. But when I concatenate it with other strings, it doesn't work. Check out this jsfiddle ...

Using an ng-repeat directive alongside an if condition in Angular

My website contains a vast array of 30 articles, previously represented by around 300 lines of HTML code, but now condensed to just 10 lines with angularjs. However, certain articles hold special significance and require specific display criteria. Check ou ...

What methods can I use to emphasize three distinct dates?

I'm facing difficulty highlighting three specific dates: "10-11-2020", "22-11-2020", and "07-11-2020" using React.js and Datepicker. Unfortunately, my attempts have not been successful so far. Here is the code snippet I am working with: import React, ...

Creating a custom HTML table layout with both variable and fixed column widths, along with grouping headers

Is there a way to format an HTML table so that it appears like this: <- full page width -> <-20px->< dynamic ><-20px->< dynamic > +------------------+-------------------+ ¦ A ¦ B ...

Activate an event on a shadow DOM element that is covered by an element in the light DOM (not directly related)

I am currently facing a challenge in retrieving the coordinates of a table cell within a shadow DOM. This table cell may have overlay elements displayed above it, which could span over multiple cells and may not necessarily be direct children of the cell I ...

Vuetify displaying incorrectly following deployment

After creating a spa with vue.js for the frontend, I utilized the vuetify library for various components and layout. While everything looked great locally, upon deploying to Azure, all vuetify styling seemed to disappear. My custom css was still applying ...

CSS background image referencing in React to the public folder's path

I am currently working on a project using Create-React-App and I am trying to set a background image for my header section. Here is how I'm attempting to do it: background-image: url('~/Screenshot_11.png'); However, I encountered an error w ...

Header navigation issue: sub menu fails to display

I've been trying to troubleshoot this issue, but nothing seems to quite fit my situation. My header contains an empty space (referred to as "void" in my case) and a menu directly beneath it. When scrolling down, the header moves up and the menu rema ...

The selection box for cities is not filling in with options

I am working on a dynamic city loading feature for a select tag in HTML. After selecting a state, I want to load the cities using an ajax call. While I am successfully logging the returned data to the console, I am struggling with populating the select op ...

How can one retrieve the 'alt' attribute text from an image tag on a webpage using the JSOUP library in an Android application?

Extracting the 'alt' text from an 'img' tag in Android after clicking a button is causing issues. The attempted code is not working as expected. Here is the snippet of the code that was used: Document doc = Jsoup.connect(url).get(); ...

Customized content is delivered to every client in real-time through Meteor

I am currently working on creating a multiplayer snake game using three.js and meteor. So far, it allows one player to control one out of the three snakes available. However, there is an issue where players cannot see each other's movements on their s ...