背景を2色にクッキリと半分に分けるCSSです
斜め
.sec {
background: linear-gradient(45deg, #000000 0%, #000000 50%, #fff000 50%, #fff000 100%);
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 500px;
}
.sec p {
color: #fff;
font-size: 36px;
font-weight: bold;
}
左右
.sec {
background: linear-gradient(90deg, #000000 0%, #000000 50%, #fff000 50%, #fff000 100%);
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 500px;
}
.sec p {
color: #fff;
font-size: 36px;
font-weight: bold;
}
上下
.sec {
background: linear-gradient(180deg, #000000 0%, #000000 50%, #fff000 50%, #fff000 100%);
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 500px;
}
.sec p {
color: #fff;
font-size: 36px;
font-weight: bold;
}