Struggle to position images in the center of an HTML and CSS website

I recently helped create a website for my friend at

Unfortunately, the logos underneath (see pictures) are not showing up centered. Additionally, when viewing the site on a mobile device, everything looks off. Can anyone provide assistance with this issue?

THANK YOU so much in advance for any help!

Check out the screenshot on a smartphone here

Answer №1

The logo containers (.container-erfahr ul li) are currently set to float left in their CSS. Due to the second one being taller than the third, the fourth is displayed below the third (and to the right of the second) in mobile view - as per the behavior of floats.

To rectify this and center them instead, remove the float: left and change them all to display: inline-block. For centering, add text-align: center to the container element .container-erfahr.

Here are the updated rules:

.container-erfahr ul li {
    display: inline-block;
    margin: 30px;
    padding: 0px;
    border: 0px solid lightgray;
    list-style: none;
}

.container-erfahr {
    margin-top: 100px;
    margin-left: 0px;
    text-align: center;
}

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

Submitting modal form information using AJAX to PHP

As a novice in the realm of web programming, I find myself seeking some guidance to untangle a riddle. Regrettably, my grasp of the basics still leaves much to be desired. Within my main page, view.adminsettings.php, I've designated a Navigation DIV ...

What is the best way to align an InputAdornment IconButton with an OutlinedInput in Material-UI?

Struggling to replicate a text input from a mockup using Material-UI components. Initially tried rendering a button next to the input, but it didn't match. Moving on to InputAdornments, getting closer but can't get the button flush with the input ...

D3 not distinguishing between bars with identical data even when a key function is implemented

When attempting to create a Bar chart with mouseover and mouseout events on the bars using scaleBand(), I encountered an issue. After reviewing the solution here, which explains how ordinal scale treats repeated values as the same, I added a key to the dat ...

When you have a target element that is deeply nested, consider using a 50% height relative to

There is some confusion surrounding the issue below: <div class="container"> <div class="row"> <div class="group"> <a> <div class="col-lg-3 full-h"></div> </a> <a> < ...

Try implementing a body template when using the mailto function

Is there a way to customize an HTML template for the mailto() function body? For example, suppose I have the following link: echo "<a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="97f2faf6fefbd7f0faf6fefbb ...

Save the $username and $file variables into the $_SESSION once the user logs in

Starting from index.php, I retrieve the values of the username and password fields using $_POST. index.php if(isset($_POST["username"]) && isset($_POST["password"])){ $username = mysql_real_escape_string(strtolower($_POST['username&apos ...

In JavaScript, use the href property to redirect to an external URL and then automatically scroll to a specific class on the page

I have a specific scenario where I need to create a link that redirects to an external website, of which I do not own. However, I am aware that there is a div with a particular class located at the bottom of their page, linking to an article. My goal is to ...

Create Event Button for Your Schedule

Looking to create a button that can add events to a calendar using only HTML and CSS, without the need for Javascript. While I've come across similar solutions involving Javascript, I'm specifically focused on finding a solution that doesn't ...

Tips for concealing text when the background size changes

Currently, I am in the process of developing a new website for our web design company. One key task is to hide the mobile navigation text while keeping the background visible, and vice versa. The current animation achieves this effect by causing the text ...

Select: Exchange icon when clicked

UPDATE MENU ICON jsfiddle.net/a3MKG/83/ Can someone provide guidance on how to change the menu icon image upon clicking it? I would like the icon to switch to a different image (such as an X) once it has been clicked. Please Note: When the menu icon is c ...

Generate headers for tables that are created dynamically in HTML

I need to develop a table where some of its columns are generated dynamically based on database values. So far, everything seems to be going smoothly. However, I am facing an issue with the dynamic table headers. I want to create two sub-headers for each ...

Taking pictures on my website with the help of c#, HTML (excluding HTML 5), and javascript

My current project requires me to capture an image from a webcam, and I have been brainstorming solutions. However, there are specific conditions that I must adhere to in order to achieve the desired result: I am unable to utilize HTML5 due to compatibil ...

Swapping out outdated identifiers with updated ones can be easily achieved using jQuery

My attempt to update my old ID with a new one has hit a snag. What steps can I take to troubleshoot this issue? $("#addfield").click(function(){ alert($(this).data('id')+1); $(this).data('id', + $('#addfield').data( ...

Implementing a Toggle Class Feature in a Function

I am currently facing an issue with a function that triggers an overlay on mouseenter event and needs to be unbound. I want to incorporate a way to close the overlay with a specific 'x' element and allow the user to trigger the event again. Howev ...

My HTML form submission to the node.js file is stuck in an endless loading loop

As I work on setting up a basic form submission on my server to collect contact information, I run into an issue. The data is successfully received by my node.js server file upon submission but when I attempt to submit the form, the page tries to load the ...

Combine jQuery and CSS to create a scrollable and extended fixed header

I am experiencing an issue where the header is fixed when scrolled down, but when I scroll back up to the top, it detaches and becomes unfixed again. How can I make the header stay fixed for a prolonged period of time? Are there any specific adjustments I ...

How about organizing a bunch of icons at once?

I decided to use this unique font for my design. I wanted to create a visual representation of the sun and clouds, making sure they always move together regardless of window size: .sun:before{content:'\f113'; font-size:7em;color: #fbac13; f ...

What is the process for displaying a Bootstrap Icon on a webpage?

I recently started using Bootstrap and I'm in the process of creating a login screen for my app. I want to incorporate MDBIcons for Google, Twitter, and Facebook. I referred to the documentation provided at However, upon previewing my webpage, I enco ...

Immediate add/modify

Exploring various websites online, I've come across platforms that offer the ability to manipulate data effortlessly. From inserting records to deleting and editing them, the process seems seamless. What's intriguing is how, upon clicking the r ...

Is there a way to remove the entire row if I dismiss a bootstrap alert?

Hey there! I'm having a little issue with an alert in a row-fluid. Curious to see? Check out my fiddle. So, when I click the "x" button to dismiss the alert, the row is still visible. Any idea how I can make the entire row disappear when I dismiss it? ...