| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | --- | 
					
						
							|  |  |  | title: Create Grids within Grids | 
					
						
							|  |  |  | --- | 
					
						
							| 
									
										
										
										
											2019-07-24 00:59:27 -07:00
										 |  |  | # Create Grids within Grids
 | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-24 00:59:27 -07:00
										 |  |  | --- | 
					
						
							|  |  |  | ## Problem Explanation
 | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | A grid within a grid is made the same as any other grid. | 
					
						
							|  |  |  | 1. Just nest one element inside another, | 
					
						
							|  |  |  | 2. set them *both* to grids, | 
					
						
							|  |  |  | 3. and *POOF*! You have a grid-within-a-grid. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-24 00:59:27 -07:00
										 |  |  | **Nesting an element** | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | For any refreshers, nesting an element looks like this: | 
					
						
							|  |  |  | `<div class='gridElement'> Here is your grid | 
					
						
							|  |  |  |   <div class='nestedGridElement'>Here is your nested grid</div> | 
					
						
							|  |  |  |  </div>` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-24 00:59:27 -07:00
										 |  |  | **Setting your elements to grids** | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | After that, adjust the following CSS properties: | 
					
						
							|  |  |  | `.gridElement{ | 
					
						
							|  |  |  |   /* this gives you a grid */ | 
					
						
							|  |  |  |   display: grid; | 
					
						
							|  |  |  |  } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  .nestedGridElement{ | 
					
						
							|  |  |  |     /* this gives you a NESTED grid */ | 
					
						
							|  |  |  |     display: grid; | 
					
						
							|  |  |  |  }` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-24 00:59:27 -07:00
										 |  |  | ** Notes:** | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | After that, feel free to customize your grids however you like. | 
					
						
							|  |  |  | i.e. `grid-template-columns: auto 1fr;` might look good in that nested grid. |