CSS Patterns
We can design the background using linear-gradient(),repeating linear-gradient(),radial-gradient(),repeating-radial-gradient() functions in CSS. Use these functions to design your background what you expected instead of using background pictures and solid colors.In this article I put some simple patterns with codes in 4 different categories.
- background stripes
- linear background patterns
- circular background patterns
- zigzag background patterns
1.background stripes
Use linear-gradient(),repeating-linear-gradient() function to create background stripes.Here are some sample stripes with codes.
- vertical stripes
After changing transparent pixel we can get this one.
2.horizontal stripes
3.stripes in angle
here using degree to get stripes in any angle.here also we can get horizontal and vertical stripes.
2.Linear background patterns
linear-gradient() ,repeating-linear-gradient() are the functions use for design linear background patterns using straight lines.We can design more effects from these functions.
3.Circular background patterns
We can get the circular effects using radial-gradient(),repeating-radial-gradient() functions in css. Following are some sample circular patterns
In circular3 background position for the first radialfunction is( 0 0 )[0px from left and 0px from top]and background position for 2nd radial function is(30px 30px)[30px from left and 30px from top].We can get differnt pattern from changing the background position here.
In circular5 I only change the transparent and black level in circular2
4. ZigZag background patterns
We can design the zig-zag patterns using linear-gradient() function.Some sample patterns and their codes are showing below.
We can get different patterns just to change positions.For zig-zag3 I only change the position in zigzag3.
Try to change transparent position and percentage of colors to get more patterns.In all background patterns we only use linear-gradient() and radial-gradient() functions