Applied Visual Design: Add a box-shadow to a Card-like Element

Hi,

I don’t really get this exercise and I am not really sure, what is wrong with this code. This feedback sentence is marked on green colour (which means I am on right track?): “You should use the given CSS for the box-shadow value.”

But this sentence/feedback part is marked on grey, so there is something wrong with it: “Your code should add a box-shadow property for the thumbnail id.”

I don’t really know what to do.

<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;
  }
  
  .thumbnail{
    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">
  <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>

2 Likes

I got the answer:

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

Thank you! This helped me. I realized that I was missing one of the "6px " that comes before the last “rgba”

Thanks, this your reply helped me in understanding it better.

thanks for this! this helped only in that it revealed the other box-shadow i wasn’t seeing because I didn’t scroll over the left lol :man_facepalming:

this is what i tried but it only marked one
#thumbnail {

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

}

Thank you for the help but could someone explain why the # is required before the thumbnail and not a .

1 Like

I too wanna know this

It appears the code above has a slight typo.

Because the thumbnail is referenced as an id in the HTML (id="thumbnail"), the CSS needs to reference the id selector, which is #. (Class selectors are . )

So the CSS need to be #thumbnail{/* CSS here */}

1 Like

Rookie new member here. Thanks! I was stuck on that!