2018-10-12 15:37:13 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								---
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								title: Add Borders Around Your Elements
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								---
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								## Add Borders Around Your Elements
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-11-20 19:12:15 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								## Hint
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								To add a custom border around any HTML element, these three properties are used as shown below.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```css
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								.className {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border-width: 10px;  /*sets the width/thickness of border to 10 pixels*/
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border-color: pink;  /*sets the color of the border to pink*/
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border-style: solid; /*sets the style of the border to solid line type*/
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The same className should be used as the value for class attribute of the HTML element which has to be styled. Good Luck!
							 
						 
					
						
							
								
									
										
										
										
											2018-10-12 15:37:13 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-23 03:20:00 +04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								## Solution:
  
						 
					
						
							
								
									
										
										
										
											2018-11-20 19:12:15 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								We need to create a class called `thick-green-border` . This class should add a 10px, solid, green border around an HTML element. and after, we need to apply the class to your cat photo.
							 
						 
					
						
							
								
									
										
										
										
											2018-10-12 15:37:13 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-11-20 19:12:15 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								We add between `<style>`  and `</style>`  new class `thick-green-border`  with properties:
							 
						 
					
						
							
								
									
										
										
										
											2018-10-23 03:20:00 +04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-11-20 19:12:15 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```css
							 
						 
					
						
							
								
									
										
										
										
											2018-10-23 03:20:00 +04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  .thick-green-border {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border-color: green;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border-width: 10px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border-style: solid;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Also, we can add properties this way:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-11-20 19:12:15 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```css
							 
						 
					
						
							
								
									
										
										
										
											2018-10-23 03:20:00 +04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  .thick-green-border {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border: 10px solid green;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The final stage is adding this class to image:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-11-20 19:12:15 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```html
							 
						 
					
						
							
								
									
										
										
										
											2018-10-23 03:20:00 +04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< img  class = "smaller-image thick-green-border"   
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								src="https://bit.ly/fcc-relaxing-cat" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								alt="A cute orange cat lying on its back.">
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```