Picture placement adjusted

After changing the pictures, the position of the image shifted.

Here is where the old photos were positioned

And this shows the new positions with the updated photos

.column-2 {
  float: left;
  width: 33.3%;
  padding: 5px;
  padding-right: 30px;
  display: inline-block;
}

.column-3 {
  float: right;
  width: 30%;
  display: inline-block;
  padding-right: 30px;
  padding
}

.section-team {
  text-align: center;
}

.members {
  border-radius: 50%;
}

.upm {
  padding-top: 25px;
  padding-right: 5px;
}
<section class="section-team" id="team">
  <div class="row">
    <h2>team members</h2>
  </div>
  <div class="column-2">
    <img src="img/Picture1.jpg" class="members" alt="members" style="width:50%">
    <h3>Adam</h3>
  </div>
  <div class="column-2">
    <img src="img/Picture2.jpg" class="members" alt="members" style="width:50%">
    <h3>Adam</h3>
  </div>
  <div class="column-2">
    <img src="img/Picture3.jpg" class="members" alt="members" style="width:50%">
    <h3>Adam</h3>
  </div>
  <div class="column-2">
    <img src="img/Picture5.jpg" class="members" alt="members" style="width:50%">
    <h3>Adam</h3>
  </div>
  <div class="column-2">
    <img src="img/Picture4.png" class="members" alt="members" style="width:50%">
    <h3>Adam</h3>
  </div>
  <div class="column-2">
    <img src="img/Picture6.jpg" class="members" alt="members" style="width:50%">
    <h3>Adam</h3>
  </div>
  <div class="column-3">
    <img src="img/upm.jpg" class="upm" alt="upm" style="width:30%">
    <h4>Partnered with UPM</h4>
  </div>

I'm looking for guidance on how to position the current photos similar to those in the original picture.

Answer №1

Your divs should be treated as containers, not just for defining space for the image itself. Ensure that ".column-2" and ".column-3" determine the space occupied by the container holding the image, not the image itself.

To resolve this issue, adjust widths using calc() to factor in padding. Subtract the padding from the container's width to ensure the total equals 100% after excluding non-relative measurements. Additionally, if .column-3 is the sole column in a row, it should have a width of 100%.

An optional suggestion is to refactor your columns for better reusability. Name each column class based on the number of columns out of 12 it occupies (common in themes). For instance, rename .column-2 to .column-4 for a third of a row, and .column-3 to .column-12 for an entire row. Standardize column behaviors such as floats and paddings, reserving sub-elements for unique properties.

.column-4 {
  float: left;
  box-sizing: border-box;
  width: 33.3%; 
  display: inline-block;
  padding: 5px;
  padding-right: 30px;
}

.column-12 {
  float: left;
  box-sizing: border-box;
  width: 100%; 
  display: inline-block;
  padding: 5px; 
  padding-right: 30px;
}

.upm {
  float: right; 
  padding-top: 20px; 
}

/* Update column class names in your HTML */

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

Troubleshooting issues with adding CSS classes in jQuery intermittently not functioning

I need to detect a specific class from a color picker and then change the class of a header tag. // To locate the specific header id with the 'bgt' CSS class. Detecting the id from a div that contains the '.ss' CSS class. $(document.b ...

Issue with submitting form using Jquery on select action

There seems to be an issue with this jquery code that is supposed to trigger a form submit when a drop down select is changed. It works fine on our test site, but once we move it to the live website, it breaks. Can someone help us troubleshoot and identify ...

Struggling to determine if the checkbox has been ticked?

I have integrated a like button on my website using socket io to ensure that it updates for all users when the like button is clicked. I have successfully implemented a like() function that emits liked, increments a counter, and displays it on the page. Ho ...

Ways to obtain the height of a UL element while the display property is configured to flex

While I was blockwise segregating elements of a webpage and drawing borders around those blocks, I encountered an issue where the height turned out to be 0 when the display was set to flex. How can I retrieve the height in such scenarios? I experimented wi ...

Is the use of the "inherit" value for style properties essential in HTML design?

My question is simple: why is there an "inherit" value for (almost) all properties in HTML-CSS when all browsers already support inheritance for all properties? When I searched on Google, I found a statement that said: "Even though certain characteristi ...

What is the reason for index always being not equal to 0?

<script> var index = 0; $.getJSON("./data/data.json", function(json) { $.each(json, function(data) { var html = ""; if(index == 0) { console.log(index + " fir ...

Is it possible to create an app apk using jQuery Mobile that pulls its information directly from a website?

Currently in the process of developing a blog app using jQuery Mobile. Once completed, my plan is to host it online as a mobile website under a specific domain. However, I also want users to have the option to download it as an app from the app stores. A ...

How to change the divider color in Angular Material table's header row

Currently struggling with customizing the divider appearance in the Angular Material table. Despite trying various approaches in the Chrome dev tools, I am unable to modify the color and thickness of the divider after the header row. It seems that the bord ...

How can I make the Bootstrap tooltip only appear when clicked inside a Vue Component and disappear when hovered over?

I am having a challenge with Bootstrap ToolTip in my Vue component. I only want the notice to show when the button is clicked, not on hover as it currently behaves. I attempted using jQuery within the Vue component without success. Can someone please adv ...

Page positioned absolutely with a sticky footer

Introducing myself to those familiar with my previous query on the topic of Stick Footer (not sticking!), I am in search of guidance once again. Special thanks to Andres Ilich for shedding light on why my footer failed to adhere to the bottom of the page - ...

Why does my array seem to update only once in the view?

I am currently working on a project that aims to visually represent sorting algorithms, but I have encountered an issue. In order to effectively visualize the sorting process of an algorithm, it is crucial to display every change in the array as the proc ...

Choose the content in the second column

Can anyone help me with CSS selectors? I've been trying to target the second .col_content element in my code to apply a specific background image, but I haven't had any luck so far. Adding a second class would be an easy fix, but I'm curious ...

Switch input value when tabbing

I'm currently developing a small web application to track the work hours of team members. Everything seems to be functioning properly, except for one issue. When I navigate to a fieldset, a new page opens with a form to edit the time for that specific ...

Use jQuery to open and close HTML tags efficiently

It seems like the task I have at hand may not be as simple as I had hoped, so here I am seeking some reassurance. I am aiming to switch out an image with a closing div, then the image itself, followed by another opening div. Let me illustrate this with a ...

Instructions for showing a particular image on a different page upon clicking a button with JavaScript

I have created a fictional ecommerce website as a personal project. The home page features image links to various shoe products, each with its own product page containing an image, name, and placeholder description. When users click the "Buy Now" button on ...

HTML, JavaScript, and PHP elements combine to create interactive radio buttons that trigger the appearance and disappearance of mod

On my page, I have multiple foreach loops generating divs with different information. These divs are displayed in modals using Bootstrap. However, I am encountering an issue where if I select a radio button and then close the modal and open another one, th ...

Dealing with Issues of HTML and CSS Positioning

Why are my buttons not maintaining their positions correctly when the window is resized? I thought it should work as intended. In my previous inquiry, I was able to successfully position elements for window resizing (CSS Top Relative To Screen). However, ...

Click on the link to trigger the function that retrieves the value from the element with the ID "email"

I am completely new to HTML and JavaScript and currently building a website using Wix.com. The website will only consist of a text box and a button. While Wix.com is a user-friendly site builder, it lacks full HTML editing capabilities. This means I have ...

Issue Encountered While Trying to Upload File Using Ajax

I have been encountering an issue with uploading a file using Ajax. My goal is to upload a single file only. Below are the snippets of code that I have utilized. HTML & Ajax $(document).ready(function(){ $("input:submit").on('click', func ...

Ways to incorporate or invoke Java code within an HTML document

I'm in the process of creating an HTML file that includes multiple dropdowns. The options in the second dropdown will depend on the selection made in the first dropdown, and similarly, the third dropdown will depend on the second one, and so forth. ...