@ecemgo
Posted
Some recommendations regarding your code that could be of interest to you.
If you want that this solution is responsive, I suggest some techniques without using media query for this solution. Also, I recommend avoiding repetition in your code and not using styles that don't work.
- If you want to make the card centered both horizontally and vertically, you'd better add flexbox and
min-height: 100vh
to thebody
- For the color of the screen, you can use the recommended color in the body
body {
/* background-color: hsla(195, 43%, 91%, 0.72); */
background-color: hsl(212, 45%, 89%);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
- When you use flexbox in the
body
, you don't need to useleft
,top
in the.qr_code
to center the card - If you use
max-width
, the card will be responsive and you can reduce the width a bit
.qr_code {
/* height: 484px; */
/* width: 335px; */
max-width: 300px;
padding: 20px;
background-color: white;
/* position: absolute; */
/* top: 19%; */
/* left: 38%; */
border-radius: 12px;
}
- 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%
to the img
.qr_code img {
/* height: 290px; */
/* width: 302px; */
width: 100%;
border-radius: 8px;
}
- You'd better add
margin
to texts
.image_content h1{
/* padding: 10px; */
/* margin-top: -25px; */
margin: 20px 0;
}
.image_content p{
margin-bottom: 20px;
}
- Finally, if you follow the steps above, the solution will be responsive
- You can remove media queries and these styles below to clean the code because you don't need to use them
/* .imgqr {
padding: 28px;
margin-left: -12px;
margin-top: -14px;
} */
/* .image_content{
margin-left: -8px;
} */
Hope I am helpful. :)
Marked as helpful
@codermohit1265
Posted
@ecemgo Thanks for your advices I'm working on my coding skills and started frontend mentor just few days before surely i will work on your advices .Thanks for your feedback edit- Can you tell me the place where i can learn css and JavaScript more deeply and improve my skills