"Basic CSS: Add Borders Around Your Elements"

Hello Guys!

I got stuck just in this part! I just wrote exactly what I was asked. Maybe should I write something else?

border-width: 10px;

Thanks in advance!

C.B.

Your code so far


<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
  color: red;
}

h2 {
  font-family: Lobster, monospace;
}

p {
  font-size: 16px;
  font-family: monospace;
}

.smaller-image {
  width: 100px;
.thin-green-border
  border-width: 10px;
  border-style: solid;
  border-color: green;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>
<main>
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>

<div>
  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
</div>

<form action="https://freecatphotoapp.com/submit-cat-photo">
  <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
  <label><input type="checkbox" name="personality" checked> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label><br>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36.

Challenge: Add Borders Around Your Elements

Link to the challenge:

You’re missing an ending curly bracket after this.

Also thin-green-border’s starting curly brace is missing.


Refactor this,

.smaller-image {
  width: 100px;
.thin-green-border
  border-width: 10px;
  border-style: solid;
  border-color: green;
}

to

.smaller-image {
  width: 100px;
}
.thin-green-border {
  border-width: 10px;
  border-style: solid;
  border-color: green;
}

Hi! It says there " Create a class called thick-green-border" :slight_smile:
And also, you placed the selector inside another selector without an opening and closing curly braces which might result to an error. Thanks!

1 Like

Hi Piedcipher!

I tried also your way but nothing happened. My case must be something else though ! :sweat_smile:

Hi Allyza.faberllar

I have already the class thick-green-border. And also tried your way. Nothing has changed! :grimacing:

I combined my solution & @allyza.fabellar’s solution then refactored your code. It worked for me. What error are you getting when you submit the challenge?

1 Like

Hi! Maybe try refreshing the page :slight_smile: Thanks!

Hi Piedcipher!

I got stuck in this part :

border-width: 10px;

Thanks!

1 Like

Hi Allyza.fabellar!

Thanks so much! I am going to refresh it one more time!!! :wink:

C.B.

1 Like

Hi Piedchipher!

Problem solved! I was writing " thin-green-border" instead of “thick-green-border”.

Many Thanks for your help!

C.B.

2 Likes

not a bad at all. You figure it out!

1 Like

hi I’m struggling to solve this border, I have a problem here: " Add Borders Around Your Elements" https://www.freecodecamp.org/learn/responsive-web-design/basic-css/add-borders-around-your-elements
I followed all the instruction and i checked my code several times


this is what i did:

.thick-green-border {

border-width: 10px;

border-style: solid;

border-color: green;

}

.red-text {

color: red;

}

h2 {

font-family: Lobster, Monospace;

}

p {

font-size: 16px;

font-family: Monospace;

}

.smaller-image {

width: 100px;

}

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

do you have a dark mode extension? switch it off.

Thank you very much very much appreciated