Should not effect other button

    <div class="btn-wrapper">
    <div class="content-wrapper">
        <div class="block1">
        <div class="block2">
        <div class="block3">

    box-sizing: border-box;
    width: 100%;
    display: flex;
    justify-content: center;
    border: none;
    padding: 5px 15px;
    margin: 2px 10px;
    border: 1px solid #bfbfbf;
    color: #626262;
    cursor: pointer;
    background-color: #c0c0c0;
    color: #414040;
    letter-spacing: 2px;
    transition: 400ms;

I have used display flex to arrange button in a div, when you hover on any button it expand but also effect other’s position too. How to get rid of it??

.btn-wrapper>button:hover means that every button in the the .btn-wrapper should be affected by that style when any button is hovered over.

To affect the style of specifically the button you hover over, you should instead use .btn-wrapper .button:hover

1 Like