Lesson 15 of 50
cssBackgrounds – Images & Gradients
10 mins
Course progress30%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 15 of 50
css10 mins
Keep these ideas in mind as you work through the lesson.
Background properties give a lot of power:
background-image – URL, gradients (linear-gradient, radial-gradient).background-size – cover, contain, or explicit dimensions.background-position – center, top left, percentages.background-repeat – no-repeat, repeat-x, repeat-y.background-attachment – fixed for parallax effects..hero {
background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('hero.jpg');
background-size: cover;
background-position: center;
color:#fff;
padding:4rem 2rem;
}