Applied Visual Design | Tutorial Bug w/ Opacity

Applied Visual Design | Tutorial Bug w/ Opacity
0

Tell us what’s happening:

I keep getting an error despite the answer largely being correct. The test response says "Your code should set the opacity property to 0.7 on the anchor tags by selecting the class of links"

But that’s exactly what the code does, so I’m not really sure of what else I’m supposed to do.

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;
  opacity: .7;
}
#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>
    <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/78.0.3904.87 Safari/537.36.

Challenge: Decrease the Opacity of an Element

Link to the challenge:
https://www.freecodecamp.org/learn/responsive-web-design/applied-visual-design/decrease-the-opacity-of-an-element

“0.7”, not “.7”.

@ArielLeslie Shouldn’t it technically work with either .7 or 0.7 across all browsers? It seems to work with either in Chrome. If so, I will fix that test for this challenge.

When I ran it in Firefox it works with “0.7” but not if I deleted the “0”. I assume that the test is looking at the entered text.

eta: Firefox, not Chrome

Yes, the test is looking for 0.7. What I was asking is if the test should allow either.

Ah. This is one that I don’t have strong opinions on either way. On one hand “0.7” and “.7” are functionally equivalent. On the other hand, a specific value was dictated by the instructions and matching a value exactly is something that campers are going to deal with fairly often.

If I use either .7 or 0.7 in Chrome or Firefox the opacity changes. We have changed quite a few tests to be a bit more flexible as long as the syntax is valid. If you are ok with either, I will put a PR in now.

:+1: Thanks for doing that.

Done. That was an easy one. PR #37715

1 Like