Tell us what’s happening:
I am getting error as below, Please help
Your .blog-post element should have a color of red.
Your h2 elements should have a color of red.
Your code so far
<style type='text/sass'>
$text-color: red;
.header{
text-align: center;
}
.blog-post h2 {
color: $text-color;
}
</style>
<h1 class="header">Learn Sass</h1>
<div class="blog-post">
<h2>Some random title</h2>
<p>This is a paragraph with some random text in it</p>
</div>
<div class="blog-post">
<h2>Header #2</h2>
<p>Here is some more random text.</p>
</div>
<div class="blog-post">
<h2>Here is another header</h2>
<p>Even more random text within a paragraph</p>
</div>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.
A comma can be used to apply a style to multiple classes, but I don’t believe that you can use it to apply a style to both a class and an element. The blog-post class and h2 element need their own style declarations. You aren’t asked to do anything with p elements.
Ok. Apparently you can use a comma with both classes and elements. All you need to do from to the code that FCC provides is create the variable and change red to the variable name. You don’t need to change any selectors and don’t remove the comma.
I can’t reproduce your error. Please create a GitHub Issue. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible. Please include your browser version and list any browser extensions you may be using.
Just fyi some of the Sass challenges, including this one are a bit buggy, what you’ve got there is correct. I asked about it on github and they directed me to this thread, said they’re working on refactoring it: https://github.com/freeCodeCamp/freeCodeCamp/issues/12699