freeCodeCamp/guide/english/certifications/responsive-web-design/basic-css/add-borders-around-your-ele.../index.md

34 lines
926 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Add Borders Around Your Elements
---
## Add Borders Around Your Elements
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
2018-10-12 19:37:13 +00:00
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 19:37:13 +00:00
## Solution:
2018-10-12 19:37:13 +00:00
We add between ```<style>``` and ```</style>``` new class ```thick-green-border``` with properties:
```js
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
}
```
Also, we can add properties this way:
```js
.thick-green-border {
border: 10px solid green;
}
```
The final stage is adding this class to image:
```js
<img class="smaller-image thick-green-border"
src="https://bit.ly/fcc-relaxing-cat"
alt="A cute orange cat lying on its back.">
```