| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | --- | 
					
						
							|  |  |  | title: Use a CSS Linear Gradient to Create a Striped Element | 
					
						
							|  |  |  | --- | 
					
						
							| 
									
										
										
										
											2019-07-24 00:59:27 -07:00
										 |  |  | # Use a CSS Linear Gradient to Create a Striped Element
 | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-24 00:59:27 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | ## Solutions
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <details><summary>Solution 1 (Click to Show/Hide)</summary> | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-09 19:27:28 +05:30
										 |  |  | ```html | 
					
						
							|  |  |  | <style> | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-09 19:27:28 +05:30
										 |  |  |   div{  | 
					
						
							|  |  |  |     border-radius: 20px; | 
					
						
							|  |  |  |     height: 400px; | 
					
						
							|  |  |  |     margin:  50 auto; | 
					
						
							|  |  |  |     background: repeating-linear-gradient( | 
					
						
							|  |  |  |       45deg, | 
					
						
							|  |  |  |       yellow 0px, | 
					
						
							|  |  |  |       yellow 40px, | 
					
						
							|  |  |  |       black 40px, | 
					
						
							|  |  |  |       black 80px | 
					
						
							|  |  |  |     ); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </style> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <div></div> | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-24 00:59:27 -07:00
										 |  |  | #### Relevant Links
 | 
					
						
							| 
									
										
										
										
											2019-03-09 19:27:28 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  | * [MDN | Repeating Linear Gradient](https://developer.mozilla.org/en-US/docs/Web/CSS/repeating-linear-gradient) | 
					
						
							| 
									
										
										
										
											2019-07-24 00:59:27 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | </details> |