"Inherit" value purpose in Responsive Web Design by Building a Piano

Tell us what’s happening:
Can someone help me understand the purpose of the “inherit” value? I don’t get how this is applied on building the piano, and also why the pseudo elements ::before and ::after are used in box-sizing: inherit;

  **Your code so far**
/* file: styles.css */
html {
box-sizing: border-box;

*, *::before, *::after {
box-sizing: inherit;

#piano {
background-color: #00471b;
width: 992px;
height: 290px;
margin: 80px auto;
padding: 90px 20px 0 20px;

.keys {
background-color: #040404;
width: 949px;
height: 180px;
padding-left: 2px;

  **Your browser information:**

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

Challenge: Learn Responsive Web Design by Building a Piano - Step 16

Link to the challenge:

Check out this CSS tricks article.

1 Like

got it! thanks a lot…

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