Hi there
Thank you in advance for your replies!
My question is on Step 56 and I am not stuck but am rather looking for some explanations. I used chatgpt to ask questions and I think my thought process is right.
so just to outline the details the code is on css:
"body {
background-image: url(https://cdn.freecodecamp.org/curriculum/css-cafe/beans.jpg);
}
h1, h2, p {
text-align: center;
}
.menu {
max-width: 500px;
width: 80%;
background-color: burlywood;
margin-left: auto;
margin-right: auto;
padding: 20px;
}"
the question was :
The current width of the menu will always take up 80% of the body
element’s width. On a very wide screen, the coffee and dessert appear far apart from their prices.
Add a max-width
property to the menu
class with a value of 500px
to prevent it from growing too wide.
So the reason I am confused is because I understand the concept and why we are doing it but dont understand why.
So the objective is to set the max width at 500px and the max width the .menu class can use of this is 80%.
would it not be better to write this within the body element rather than the .menu class.
is there any reason you would want to set the max-width to individual classes rather than the body element itself?
I hope that all makes sense, maybe I am just jumping the gun and step 57 is going to tell me we can put this in the body xD but thought I would ask incase it has more complex uses further down the line of my journey.
Best Wishes
John