Learn More About CSS Pseudo Selectors by Building A Balance Sheet - Step 42

Tell us what’s happening:

What am I doing wrong?Please assist me! I followed all instructions. Instructions are to give #years a margin of 0 -2 px and padding of 0.5rem calc(1.25rem +2px) 0.5rem 0

Your code so far

<!-- file: index.html -->

/* file: styles.css */
/* User Editable Region */

#years {
  
  display: flex;
  justify-content: flex-end;
  position: sticky;
  top: 0;
  background: #0a0a23;
  color: #fff;
  margin:0 -2px;
  padding:0.5rem calc(1.25rem +2px) 0.5rem 0;
}

/* User Editable Region */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0

Challenge Information:

Learn More About CSS Pseudo Selectors by Building A Balance Sheet - Step 42

I think what the test wants from you is to give approprate spacing.

in the padding section you should space out

the + and the 2px

And its good practice to give space after a property before giving values
padding: 0.5rem calc(1.25rem + 2px) 0.5rem 0; something like this or thiks margin: 0 -2px; will be okay.

1 Like

Hi there @zm17jaga

Well, it seems you need to do the spacing(Indentation) correctly.

#years {
  
  display: flex;
  justify-content: flex-end;
  position: sticky;
  top: 0;
  background: #0a0a23;
  color: #fff;
  margin:0 -2px; [No space at starting]
  padding:0.5rem calc(1.25rem +2px) 0.5rem 0; [No space at starting]
}

/* User Editable Region */

Happy coding!