html – Have icons display in rows when on mobile device-ThrowExceptions

Exception or error:

These icons are supposed to be in two rows of three on mobile, however they have ended up in one single column. How do I fix this problem?

HTML

    <div class="skill-section">
        <div class="skill-box"><img src="html.svg" alt=""></div>
        <div class="skill-box"><img src="css.svg" alt=""></div>
        <div class="skill-box"><img src="js.svg" alt=""></div>
        <div class="skill-box"><img src="sass.svg" alt=""></div>
        <div class="skill-box"><img src="react.svg" alt=""></div>
        <div class="skill-box"><img src="python.svg" alt=""></div>
    </div>

CSS

.feature-box{
    display: inline-block;
    width: 33%;
    padding: 20px 30px;
    text-align: center;
    img{
        width: 150px;
        margin: 0 0 12px 0;
        line-height: 1;
    }
    p{
        font-size: 1.5rem;
    }
}

Media Query

/* Skills */
section .skill-section{
    display: inline-block;
    text-align: center;
    .skill-box{
        display: inline-block;
        width: 44%;
            img{
                width: 44%;
                padding: 10px;
            }
    }
}       
How to solve:

Try to remove the section before .skill-section, in your CSS.
Maybe this was your problem?

I added in a fiddle, a height and background.. to see the skill boxes.
It looks correct, if this is what you want to achieve:

enter image description here

Or maybe show some more code lines, for better help/information.

###

/* Skills */
#skills{
    margin: 0 auto;
    text-align: center;
    .feature-box{
        display: inline-block;
        width: 25%;
        img{
            width: 30px;
        }
    }

}  

Leave a Reply

Your email address will not be published. Required fields are marked *