{"componentChunkName":"component---src-templates-blog-post-js","path":"/blog/freecodecamp/frontend/css/fcc-challenge-18-add-borders-around-your-elements/","result":{"data":{"site":{"siteMetadata":{"title":"Be Brav3"}},"markdownRemark":{"id":"a0ea9f26-9961-5da3-aa19-38020efdf9e1","excerpt":"In Free Code Camp Challenge 18 we’re using cascading style sheets to add a border to our image: css h2 { font-family: Lobster, Monospace; } p { font-size: 16px…","html":"<p>In <a href=\"https://www.freecodecamp.com/challenges/add-borders-around-your-elements\">Free Code Camp Challenge 18</a> we’re using cascading style sheets to add a border to our image:</p>\n<p>[css]</p>\n<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">\n  \n<style>\n    \n.red-text {\n      \ncolor: red;\n    \n}\n<p>h2 {</p>\n<p>font-family: Lobster, Monospace;</p>\n<p>}</p>\n<p>p {</p>\n<p>font-size: 16px;</p>\n<p>font-family: Monospace;</p>\n<p>}</p>\n<p>.smaller-image {</p>\n<p>width: 100px;</p>\n<p>}</p>\n</style>\n<h2 class=\"red-text\">CatPhotoApp</h2>\n<img class=\"smaller-image\" src=\"https://bit.ly/fcc-relaxing-cat\" alt=\"A cute orange cat lying on its back. \">\n<p class=\"red-text\">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>\n  \n<p class=\"red-text\">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>\n  \n[/css]\n<p>The modified code should look like:</p>\n<p>[css]</p>\n<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">\n  \n<style>\n    \n.red-text {\n      \ncolor: red;\n    \n}\n<p>h2 {</p>\n<p>font-family: Lobster, Monospace;</p>\n<p>}</p>\n<p>p {</p>\n<p>font-size: 16px;</p>\n<p>font-family: Monospace;</p>\n<p>}</p>\n<p>.smaller-image {</p>\n<p>width: 100px;</p>\n<p>}</p>\n<p>.thick-green-border {</p>\n<p>border-color: green;</p>\n<p>border-width: 10px;</p>\n<p>border-style: solid;</p>\n<p>}</p>\n</style>\n<h2 class=\"red-text\">CatPhotoApp</h2>\n<img class=\"smaller-image thick-green-border\" src=\"https://bit.ly/fcc-relaxing-cat\" alt=\"A cute orange cat lying on its back. \">\n<p class=\"red-text\">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>\n  \n<p class=\"red-text\">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>\n  \n[/css]\n<blockquote>\n<p>CSS borders have properties like style, color and width</p>\n<p>For example, if we wanted to create a red, 5 pixel border around an HTML element, we could use this class:</p>\n</blockquote>\n<blockquote>\n<p>[css]</p>\n</blockquote>\n<blockquote>\n<style>\n</blockquote>\n<blockquote>\n<p>.thin-red-border {</p>\n</blockquote>\n<blockquote>\n<p>border-color: red;</p>\n</blockquote>\n<blockquote>\n<p>border-width: 5px;</p>\n</blockquote>\n<blockquote>\n<p>border-style: solid;</p>\n</blockquote>\n<blockquote>\n<p>}</p>\n</blockquote>\n<blockquote>\n</style>\n</blockquote>\n<blockquote>\n<p>[/css]</p>\n<p>Create a class called thick-green-border that puts a 10-pixel-wide green border with a style of solid around an HTML element, and apply that class to your cat photo.</p>\n<p>Remember that you can apply multiple classes to an element by separating each class with a space within its class attribute. For example:</p>\n<p>[html]<img class=\"class1 class2\">[/html]</p>\n</blockquote>","frontmatter":{"title":"FCC Challenge 18: Add Borders Around Your Elements","date":"March 07, 2016","description":null}}},"pageContext":{"slug":"/blog/freecodecamp/frontend/css/fcc-challenge-18-add-borders-around-your-elements/","previous":{"fields":{"slug":"/blog/freecodecamp/frontend/css/fcc-challenge-17-size-your-images/"},"frontmatter":{"title":"FCC Challenge 17: Size your Images"}},"next":{"fields":{"slug":"/blog/freecodecamp/frontend/css/fcc-challenge-19-add-rounded-corners-with-a-border-radius/"},"frontmatter":{"title":"FCC Challenge 19: Add Rounded Corners with a Border Radius"}}}}}