Add a box-shadow to a Card-like Elementss

Tell us what’s happening:

Your code so far


<style>
  h4 {
    text-align: center;
    background-color: rgba(45, 45, 45, 0.1);
    padding: 10px;
    font-size: 27px;
  }
  p {
    text-align: justify;
  }
  .links {
    text-align: left;
    color: black;
  }
  .box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
  
  .fullCard {
    width: 245px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin: 10px 5px;
    padding: 4px;
  }
  .cardContent {
    padding: 10px;
  }
  .cardText {
    margin-bottom: 30px;
  }
</style>
<div class="fullCard" id="thumbnail" box-shadow:0px 10px 20px rgba(0,0,0,0.19),0px 6px 6px rgba(0,0,0,0.26);>
  <div class="cardContent">
    <div class="cardText">
      <h4>Alphabet</h4>
      <hr>
      <em><p>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</p></em>
    </div>
    <div class="cardLinks">
      <a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
      <a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
    </div>
  </div>
</div>

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 6.0; A1601 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.68 Mobile Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/applied-visual-design/add-a-box-shadow-to-a-card-like-element

Your code should add a box-shadow property for the thumbnail id.

You should add a #thumbnail selector:

#thumbnail {

}

That’s where you’ll place the box-shadow.

7 Likes

Can you explain why and how you knew you had to put #thumbnail?

I just finished this part of the course and still don’t understand it even with the answer.

It was in the specifications (tests)

Your code should add a box-shadow property for the thumbnail id.

#thumbnail {
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}

1 Like

an ID selector is a name preceded by a hash character (“#”).

2 Likes

Where did you get the 0 6px 6px rgba(0,0,0,0.23); at?
I did the whole code right except for adding that part in the box shadow… I didn’t see it in the question and don’t see the correlation.

1 Like

welcome to the forums @aalreynolds. In the lesson it shows a sample CSS to create multiple shadows with a blur. That sample has a scrollbar under it. Scroll to see it all.

1 Like

Wow! I would have never guess it. I notice “bar” ,but never thought i could scroll it . this code angered me. I had to leave freecodecamp and google the code.lol

<style>

  h4 {

    text-align: center;

    background-color: rgba(45, 45, 45, 0.1);

    padding: 10px;

    font-size: 27px;

  }

  p {

    text-align: justify;

  }

  .links {

    text-align: left;

    color: black;

  }

  .fullCard {

    width: 245px;

    border: 1px solid #ccc;

    border-radius: 5px;

    margin: 10px 5px;

    padding: 4px;

  }

  .cardContent {

    padding: 10px;

  }

  .cardText {

    margin-bottom: 30px;

  }

  #thumbnail {

    box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);

  }

</style>

<div class="fullCard" id="thumbnail">

  <div class="cardContent">

    <div class="cardText">

      <h4>Alphabet</h4>

      <hr>

      <p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>

    </div>

    <div class="cardLinks">

      <a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>

      <a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>

    </div>

  </div>

</div>

Here is the answer

Hi @gautham.hc!

Welcome to the forum!

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

You can post solutions that invite discussion (like asking how the solution works, or asking about certain parts of the solution). But please don’t just post your solution for the sake of sharing it.
If you post a full passing solution to a challenge and have questions about it, please surround it with [spoiler] and [/spoiler] tags on the line above and below your solution code.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).