中途半端な背景色を擬似要素で作成

.service{
    position: relative;
}
 
.service::after{
    content: '';
    position: absolute;
    width: 100%;
    height: 400px;
    background-color: #3E3E3E;
    top: 0;
   z-index: -1;
}

要素にrelativeをかける

疑似要素::afterで
上画像の黒の背景部分を作成

この記事をシェアする