Applied Visual Design: Background-Color Challenge

Applied Visual Design: Background-Color Challenge
0

‘’’
Tell us what’s happening:

I am wondering what I may be missing in this exercise. The tester says my code is incorrect. It keeps saying I have not added a background-color element to h4 element. I triple checked the spelling and watched the video.

Your code so far


<style>
h4 {
  text-align: center;
  padding: 10px;
  background-color: rgba(45, 45, 45, 0.1)
}
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;
}
</style>
<div class="fullCard">
<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>

Your browser information:

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

Challenge: Adjust the background-color Property of Text

Link to the challenge:
https://www.freecodecamp.org/learn/responsive-web-design/applied-visual-design/adjust-the-background-color-property-of-text
‘’’

You’re missing a semicolon.

DOH!!
That’s what I get for programming early in the morning.

Many thanks davrobin.

One thing that threw me was that I still saw the grey background without the semicolon.

If this code was on a real browser what would have happened? What kind of error would I have seen, if any?

It will work as long as it’s on the last style in the style block. You can (you shouldn’t) leave off the semicolon for the last line in each block.