31
loading...
This website collects cookies to deliver better user experience
background-image: This property, although commonly used for assigning images, is where we will use gradient functions to create our patterns.
background-image: linear-gradient(180deg, black, pink);
background-image: linear-gradient(90deg, red, orange, yellow, green, blue, indigo, violet);
background: linear-gradient(0deg, blanchedalmond 33.3%, transparent 33.3%),
linear-gradient(0deg, pink 66.6%, transparent 66.6%),
lightblue
background-position: This property lets us move around the gradients within the containing element. It takes values in CSS units for the x and y axes as follows
background-position: 10px 20px;
background-size: This property lets us define the size within which the pattern is to be created. This is a complex CSS property as it can take multiple types of values. However, with respect to this blog we will need only to understand the following type.
background-size: 60px 60px;
background-repeat: This property controls how the background gets repeated in the container. Since we are attempting to create a symmetrical pattern we will ensure the value reads:
background-repeat: repeat;
background-image: linear-gradient(180deg, black, pink );
background-size: 60px 60px;
background-position: 60px 60px;
background-repeat: no-repeat;
background: linear-gradient(120deg, black 50%, transparent 50%),
white;
background: linear-gradient(60deg, black 50%, transparent 50%),
white;
background: linear-gradient(120deg, black 50%, transparent 50%),
linear-gradient(60deg, transparent 49%, black 50%),
white
background-size: 40px 40px;
background: linear-gradient(0deg, white 15%, transparent 15%) 0 6px,
linear-gradient(90deg, white 50%, transparent 50%) -10px 0
background: linear-gradient(0deg, white 15%, transparent 15%) 0 6px,
linear-gradient(90deg, white 50%, transparent 50%) -10px 0,
linear-gradient(120deg, black 50%, transparent 50%),
linear-gradient(60deg, transparent 49%, black 50%),
white;
background-size: 40px 40px;