I'm having trouble making a section with two colors (one occupying 70% of the section and the other color the remaining 30%), I would like to know how I can do this
suggestions?
You can use linear-gradient()
to achieve the desired effect.
The
linear-gradient()
function of the CSS creates an image with consistency progressive between two or more colors along a straight line.
section {
width: 100%;
height: 10rem;
background-image: linear-gradient(to bottom, blue 0, blue 70%, yellow 30%);
}
<section></section>
References: