Awesome job on this challenge!
Something I noticed; maybe it was intentional was if I click a question or the (+), (-) on an opened accordion, the accordion doesn't react or collapse. The collapse function seems to be only enabled by clicking on the opened answer or another question's question or its (+) (-) symbol. Because the questions change color on hover I hoped that clicking an opened question would also have the collapse functionality on its own.
Just thought I would let you know, cheers! 👋
Yes, some of the challenges have one or two colors missing. Some browsers have those color eye droppers to pick up color codes on the web as an extension. Or you can sometimes for instance do the following:
I found it very difficult to make it responsive, if you have any suggestions/ideas on how I can write better and scalable css to make it responsive please provide it!
In terms of responsiveness, you can use the clamp function on the width of the container to perform scalable layouts.
eg.
@media only screen and (max-width: 1440px) and (min-width: 375px) {
...
.orderSummary-card {
width: clamp(350px, 30vw, 32.7rem ); // you can play around with the values.
...
}
...
}
the first value is the smallest case scenario.
the middle value that occurs the most often and resizes depending on the screen width
the last value is the max-width you are comfortable with for scaling.
Also, for your orderSummary-card, you listed two ways to center the container inside the main. Try to stick to one.
Congratulations! on the challenge. A quick tip I would recommend is to give your container a desired margin-top value.
eg.
.container {
position: relative;
display: flex;
align-items: center;
flex-direction: column;
padding: 34px; // depending on preference; bottom padding* mainly
margin-top: 134px // depending on preference; this was my setup
}
The padding or margin-top can be excluded for an inner div, depending on if you have another content div inside for all the info. This way your accordion is prevented from expanding higher and eventually cutting off your information; especially on the mobile layout. The padding will safeguard from contents from overflowing.
Hello everyone! I would like to showcase my very first challenge here. I believe the result is faithful to the original. I had some issues with the font size. The prescribed 15px seemed a bit small to me, but it turned out that the 'container' div itself was larger than the original.
I would recommend the following for laying out your content for the future.
This way you won't have to center the container using margins or padding and the full height of the screen is utilized.
~This would hide that 1px for the pink line appearing from both sides by camouflaging with the monitor's side shadow.
Also, maybe implement a margin-top on your container, that way it stops the accordion from expanding higher. On mobile view on 375px, the content gets cut off from the bottom and can't be scrolled downwards. An accommodating margin-top and bottom padding will prevent content from getting cut off from the user's reach. Nevertheless, Keep going!
Here's my approach:
eg.
.container {
position: relative;
display: flex;
align-items: center;
flex-direction: column;
padding: 34px; // depending on preference; bottom padding* mainly
margin-top: 134px // depending on preference; this was my setup
}
Congratulations! on the challenge.
A quick tip I would recommend is to give your container a desired margin-top value.
eg.
.container {
position: relative;
display: flex;
align-items: center;
flex-direction: column;
padding: 34px; // depending on preference; bottom padding* mainly
margin-top: 134px // depending on preference; this was my setup
}
The padding or margin-top can be excluded for an inner div, depending on if you have another content div inside for all the info. This way your accordion is prevented from expanding higher and eventually cutting off your information; especially on the mobile layout.
Congratulations! on the challenge.
A quick tip I would recommend is to give your container a desired margin-top value.
eg.
.container {
position: relative;
display: flex;
align-items: center;
flex-direction: column;
padding: 34px; // depending on preference; bottom padding* mainly
margin-top: 134px // depending on preference; this was my setup
}
The padding or margin-top can be excluded for an inner div, depending on if you have another content div inside for all the info. This way your accordion is prevented from expanding higher and eventually cutting off your information; especially on the mobile layout.
I liked that your accordion stays in place and doesn't scale up and cut part of the top. Also, it's mobile-friendly.
Your panel div should be included inside your accordion div; that way the answers wouldn't stretch past or you can set smaller widths on the container.
Maybe some animations of the sort & pointer: cursor on the accordion/ questions