Having trouble with Abbreviated Hex Codes

Having trouble with Abbreviated Hex Codes
0.0 0

#1

Did anyone ever get this working?


.use Abbreviated Hex Code
#2

I moved your question to a new topic so we can focus on your code and not the code of another camper. If you want us to view your current code, then please copy/paste it into a reply or edit the post at the top with the code.

To enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


#3

I don’t see anything I’ve done wrong but it’s failing on using the shortened hex

Your code so far

<style>
  .red-text {
    color: #F00;
  }
  .fuchsia-text {
    color: #F0F
  }
  .cyan-text {
    color: #0FF
  }
  .green-text {
    color: #0F0
  }
</style>

<h1 class="red-text">I am red!</h1>

<h1 class="fuchsia-text">I am fuchsia!</h1>

<h1 class="cyan-text">I am cyan!</h1>

<h1 class="green-text">I am green!</h1>

Your browser information:

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

Link to the challenge:


#4

I merged the topic you created with the one I created for you earlier. Not sure why you did not follow my instructions pasting your code into a reply to this thread, but at least everything is together now. I unlisted the other thread, so all your responses will come to this one now.

The problem with your solution is that you are not ending each property/value pair in your style section with semi-colons. You did for the first but not the other three.


#5

What do you mean by “it’s failing”. This is what I see when I run your code:

image

The colours look fine to me.


#6

His code fails the FCC tests, because they are trying to reinforce the use of semi-colons after each property/value pair. The code works fine, because there is only one property/value pair, but if there multiple properties not separated by semi-colons, then it would not work correctly. The FCC test is checking for the semi-colons to be present. They are not all present, so the tests fail.

For example, the following would not work:

  .red-text {
    color: #F00
    font-size: 20px
  }
  .fuchsia-text {
    color: #F0F
    font-size: 20px
  }
  .cyan-text {
    color: #0FF
    font-size: 20px
  }
  .green-text {
    color: #0F0
    font-size: 20px
  }