@ecemgo
Posted
Some recommendations regarding your code that could be of interest to you.
- When you use flexbox in the
body
, you don't need to use flexbox in the.box
to center the card because it doesn't work - If you use
max-width
instead ofwidth
, the card will be responsive - I adjust the
padding
a little bit
.box {
/* display: flex; */
/* flex-direction: column; */
/* align-items: center; */
/* width: 390px; */
max-width: 300px;
/* padding-bottom: 35px; */
padding: 1.2rem 1.2rem 2rem;
/* border: 0.5rem; */
}
- In addition to that above, in order to make the card responsive and the image positioned completely on the card, you'd better add
width: 100%
anddisplay: block
for the img in this way:
img {
/* max-width: 100%; */
width: 100%;
display: block;
border-radius: 0.7rem;
}
- You don't need to use
width
for.description
because it prevents to make the card responsive if you use it
.description {
/* width: 265px; */
}
Hope I am helpful. :)
Marked as helpful
@magname
Posted
@ecemgo Thanks for your recommendation I have already updated my code
- Updated the max-width
- Updated the padding
- Updated the img tag
As for the width in the description, I gave that to break the description into three lines😅 as per the design of the challenge.