Learn More About CSS Pseudo Selectors By Building A Balance Sheet - Step 43

Tell us what’s happening:

Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 YaBrowser/23.1.1.1138 Yowser/2.5 Safari/537.36

Challenge: Learn More About CSS Pseudo Selectors By Building A Balance Sheet - Step 43

Link to the challenge:

I still do not understand why and how to write such incomprehensible code, if everything can be made easier?

#years span[class~="year"] {
font-size: 4.5rem;
font-weight: bold;

width: 4.5rem;
text-align:right ;


}

No work

1 Like

The CSS selector #years span[class~="year"] is using the ~= selector, which targets elements with a class that contains a space-separated list of words and one of those words is "year".

You are intending to target elements with a class of "year", rather than elements with a class that contains "year".

To correct this, you can replace the ~= selector with the = selector

#years span[class="year"] {
font-size: 4.5rem;
font-weight: bold;

width: 4.5rem;
text-align:right ;


}

and it doesn’t work either, everything is fine with me, everything is fine, not when it doesn’t fit, but the code can’t go further, the site is bad, to do a lot of unnecessary stuff here.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.