question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BETA: English suggestion for Basic CSS: Use a CSS Class to Style an Element

See original GitHub issue

Challenge Name

Basic CSS: Use a CSS Class to Style an Element https://beta.freecodecamp.org/en/challenges/basic-css/use-a-css-class-to-style-an-element

Issue Description

  1. It says:

“You can see that we’ve created a CSS class called blue-text within the <style> tag.”

Is it really created by referencing it in the style tag/CSS file? I thought creation happened in the HTML tag/HTML file? Or, does referencing it with CSS cause it to be added to the DOM?

If not, then it would be better to change the wording to

“we’ve referenced a…”

Given that you’ve also later called it a class declaration, I’m guessing that class creation occurs in an HTML tag, not in the CSS style rule.

  1. It then says:

“Note that in your CSS style element, classes should start with a period. In your HTML elements’ class declarations, classes shouldn’t start with a period.”

Wouldn’t it be more helpful to explain that the “.” shows compiler that the following name is a class (as opposed to a tag or ID)? Like this:

“Note that in your CSS style element, classes should start with a period. This is because the period shows the compiler that the name that follows is a class rather than a tag (or ID). In your HTML elements’ class declarations, classes shouldn’t start with a period because you use ‘class=’.”

  1. If there isn’t a challenge about multi-word class names, then you could also add a statement like this (or add a challenge):

"If your class name contains more than one word, you can write it without spaces: “myclassyname”, but it is recommended that you use capital letters to make the name easier to read: “myClassyName”.

Alternatively, you may add other characters, such as the hyphen: “my-classy-name” or the underscore: “my_classy_name”. If, however, you want spaces between those words, you’ll have to enclose the whole class name in single ‘my classy name’ or double “my classy name” quotation marks. This is especially important if you have multiple classes on a tag.

Example: HTML: <h2 class=" 'my classy name' blue-text boldText"> CSS:

 <style>
    ."my classy name" {...;}
    .blue-text {color:blue;}
    .boldText {font-weight:bold;}
 </style>

Multiple classes are separated by a space, hence the use of quotation marks. However, to reduce the risk of errors, we recommend that you don’t use spaces in class names."

Screenshot

image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
raisedadeadcommented, Feb 8, 2018

Here is what we think this needs;

Point 1: I think wording it as declaration makes it less ambiguous.

“we’ve declared a…”

Point 2: Agreed, this rewording helps calrify. Point 3: I guess we should be having a separate challenge for this one.

0reactions
QuincyLarsoncommented, Jun 3, 2018

I’m closing this issue as stale since it hasn’t been active lately. If you think this is still relevant to the newly updated platform, please explain why, then reopen it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use a CSS Class to Style an Element | freeCodeCamp
Today we learn to use CSS classes to style elements. This is another installment of my series on learning to code utilizing the...
Read more >
Use a CSS Class to Style an Element Basic CSS ... - YouTube
FOLLOW ALONG LINK: https://www.freecodecamp.org/learn/responsive-web-design/ basic - css / use-a-css - class-to-style -an-elementCheck out the ...
Read more >
Use a CSS Class to Style an Element, freeCodeCamp review ...
This challenge introduces CSS classes. A class allows you to specify which elements you want to receive certain styles.
Read more >
Remove Unused CSS - WP Rocket Knowledge Base
Remove all stylesheets and inline CSS from the HTML, and add the Used CSS as an inline CSS element after the </title> tag....
Read more >
What CSS selectors are supported for feature tagging?
Pendo uses CSS Selectors as feature rules to identify specific elements within your application. There may be situations where you want to choose...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found