My challenges with optimizing positioning in Media Queries for Hover Buttons

After completing the coding for all Smartphone devices, I moved on to working on Tablets. However, I encountered an issue during this process as I am unsure of how to fix it.

Here is a preview of my "Section Skills" layout for mobile: View Section on Mobile

For tablets, I aim to have 3 items in each row instead of 2, but I am unable to achieve this and not sure why.

.Skills{
background-color:#262626;
padding-bottom: 40px;
}

.Skills p:nth-child(1){
padding-top: 54px;
padding-left: 50px;
font-size:30px;
font-weight:900;
letter-spacing: 15px;
color:#fff;
}

.Skills p:nth-child(2){
padding-top: 4px;
padding-left: 50px;
font-size:30px;
font-weight:900;
letter-spacing: 15px;
color:#fff;
}

.Skills p:nth-child(3){
padding-top: 7px;
padding-left: 50px;
font-size:15px;
font-weight:400;
color:#fff;
}

.Skills img:nth-child(4){
padding-top: 7px;
padding-left: 51px;
}

section {
display:flex;
flex-wrap: wrap;
flex-direction:row;
 justify-content: space-between;
}

.Programme {
text-align:center;
color:#ffffff;
    padding: 20px 0 0 49px;

}

section .Programme:nth-child(2),section .Programme:nth-child(4),section .Programme:nth-child(6),section .Programme:nth-child(8) {
    padding: 20px 49px 0 0;
}

.Programme img {
-webkit-filter: grayscale(100%);
    filter: grayscale(100%);
transition: filter 1s ease;
    transition : -webkit-filter 1000ms linear;
    width: 102px;
}

.Programme img:hover {
-webkit-filter: grayscale(0%);
    filter: grayscale(0%);
transition: filter 1s ease;
    transition : -webkit-filter 1000ms linear
}

h3{
margin: 5px 0 0 0;
    font-size: 14px;
font-weight:700;
}

h4 {
margin: 5px 0 0 0;
    font-size: 12px;
font-weight: 300;
}
<article class="Skills">
        <p>MY</p>
        <p>SKILLS</p>
        <p>THIS IS WHAT I CAN DO</p>
        <img src="images/Strich_320.jpg" alt=""/>

        <section>

            <div class="Programme">
                <img src="images/Photoshop.png"/>
                <h3>PHOTOSHOP</h3>
                <h4>Expert, 5 Years</h4>
            </div>

            <div class="Programme">
                <img src="images/Illustrator.png"/>
                <h3>ILLUSTRATOR</h3>
                <h4>Expert, 5 Years</h4>
            </div>

            <div class="Programme">
                <img src="images/InDesign.png"/>
                <h3>INDESIGN</h3>
                <h4>Expert, 5 Years</h4>
            </div>

            <div class="Programme">
                <img src="images/Dreamweaver.png"/>
                <h3>DREAMWEAVER</h3>
                <h4>Expert, 5 Years</h4>
            </div>

            <div class="Programme">
                <img src="images/AfterEffects.png"/>
                <h3>AFTEREFFECTS</h3>
                <h4>Expert, 5 Years</h4>
            </div>

            <div class="Programme">
                <img src="images/PremierePro.png"/>
                <h3>PREMIERE PRO</h3>
                <h4>Expert, 5 Years</h4>
            </div>

            <div class="Programme">
                <img src="images/SonyVegas.png"/>
                <h3>SONY VEGAS</h3>
                <h4>Expert, 5 Years</h4>
            </div>

            <div class="Programme">
                <img src="images/Cinema4D.png"/>
                <h3>CINEMA4D</h3>
                <h4>Expert, 5 Years</h4>
            </div>
        </section>
    </article>

Answer №1

It's a common issue that arises when the parent containers, such as the section or article, are too narrow. This causes the horizontal padding to stretch the .programme divs beyond the available space for 3 in a row.

Consider trying this solution:

.programme {
width: 25%;
}

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

What is the best way to showcase a container within a two-column layout?

Looking to showcase the content of two columns exclusively within a container, with each column spaning the full width of the page, just like the image below. Can this be achieved using css grid? Your assistance and support is greatly appreciated. < ...

Drag and drop a Jquery image onto the div with its top left corner

Drop targets: <div id="targetContainer" style="width:100px; height:100px;> <div id="tar_0-0" class="target" style="position: relative; float:left; width:50px; height:50px; background-color: #fff;"></div> <div id="tar_1-0" class="t ...

Is there a way for me to duplicate a complex element multiple times within the same page?

As an illustration, let's say I have a social tab located in my header that I would like to duplicate in the footer. This tab is comprised of various buttons with SVG images on top, event listeners linked to button IDs, and CSS styling. One option is ...

Tips on positioning a div based on the screen dimensions

In my table, there is an icon that reveals a chart as a popup when hovered over. This div is where the chart is displayed: <div id="chart-outer" style="@style" class="popup-chart close"> <h2 id="charttitle&q ...

Use jQuery to create a toggle effect with unique attributes and incorporate AJAX functionality

When using this jQuery plugin for creating toggles, I encountered an issue with multiple toggles having the same IDs and classes. This made it difficult to identify a specific toggle to apply auto load ajax when the value changed. I'm wondering how I ...

Is it possible to incorporate a CSS3 transition into the styling of a list of images?

Looking to achieve a CSS3 linear transition for a "list-style-image" specifically for Firefox? You'll need to include "-moz-" in your code. -moz-transition: list-style-image 0.2s linear; However, the above code is not producing the desired result. I ...

Disabling the ripple effect on the primary action in React Material lists: A Step-by-Step

I was attempting to include two action buttons at the opposite ends of a list component. https://i.stack.imgur.com/juv8F.gif When clicking on the secondary action (delete icon on the right), the ripple effect is confined to just the icon. On the othe ...

The database server is not appearing on the main.js page of the client

My client's main.js file contains code that is meant to display previous form entries on the webpage, but after submitting the form, no entries appear on the HTML page. My server is running on port 7777 and the root route works in Postman, as does the ...

Transitioning React Hover Navbar Design

I'm currently revamping a click-to-open navbar into a hover bar for a new project. I have successfully implemented the onMouseEnter and onMouseLeave functions, allowing the navbar to open and close on mouse hover. However, I am facing an issue with ad ...

The Angular Material Table experienced a collapse when trying to render over 20 columns simultaneously

Currently, I am experiencing an issue in Angular Version 5 where the Angular Material Table collapses when rendering more than 20 columns. Here is a snapshot of what my table looks like: https://i.stack.imgur.com/MXfvQ.png https://i.stack.imgur.com/XHWgq ...

Is it possible to keep my JavaScript scripts running continuously within my HTML code?

I recently set up a JavaScript file that continuously queries an API for updates. It's currently linked to my index.html, but I'm looking for a way to keep it live and running 24/7 without requiring the browser to be open. Any suggestions on how ...

Achieving functionality with dropdown menus in jQuery

I am facing an issue with a dropdown menu that works perfectly in jsFiddle during testing, but does not function as expected when I run it on my testing server. jsFiddle: http://jsfiddle.net/cyberjo50/39bu8/2/ HTML <!doctype html> <html> < ...

CSS hover effect applied uniformly to all link children

Here is the HTML code snippet I am working with: <a href="">Bioshock 2<span> - Xbox 360 review</span></a> My goal is to style the first part of the link differently from the span. The desired styling should look like this: https: ...

Experience the classic game of rock-paper-scissors brought to life through JavaScript and HTML,

I've been working on a rock, paper, scissors game in JavaScript and I'm struggling to get the wins and losses to register correctly. The game keeps resulting in a draw even though I've checked my code multiple times. It's frustrating be ...

Adjusting the characteristics of a class when hovering

Is it possible to change the CSS property of a class when hovering over another class in CSS? #_nav li { display:inline; text-decoration:none; padding-top:5vh; line-height:8vh; margin-right:5vh; cursor:pointer; } #_nav li:hover + ...

"Strategies for using Selenium in Python to simulate clicks without relying on class, id, or name attributes

I am currently attempting to locate the "X" button and click on it, but I am struggling to find a way to do so. Below is the HTML code for the element: <div style="cursor: pointer; float:right; border-radius: 3px; background-color: red; font-size: ...

Issue with MaterializeCSS: Unable to add new options to select menu

I have a function that appends options to a dropdown based on the onchange event. The options are being appended successfully, but they are not visible when clicking the dropdown. $(document).ready(function(){ $('select').formSelect(); }) ...

What is the correct way to markup the semantic form label assistance text?

When designing a form, there are certain form elements that may need explanatory text to clarify their function. One approach is to wrap this text in a paragraph element, as demonstrated below: label p { margin-top: -1px; font-size: smaller; } <div ...

Error encountered when attempting to utilize a variable within an EJS template document

I seem to be encountering some difficulties while attempting to get an EJS template file to recognize a variable that holds the rows from an SQLite3 table query in a related .js file. Whenever I try to access that route by launching the server, I receive a ...

Converting units to rem dynamically in CSS: a comprehensive guide

Hey there, I'm currently trying to dynamically convert units into rem in CSS and facing some issues. I have set the root font-size as 23px The current font-size is 16px The expected result should be 16 / 23 => 0.695rem Question: I am looking for ...