@ecemgo
Posted
Some recommendations regarding your code that could be of interest to you.
- In order to center the card correctly, you'd better add flexbox and
min-height: 100vh
to thebody
- You'd better remove the
width: 100%;
you gave to thebody
in HTML.
body{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
}
- If you use flexbox in the
body
, you don't need to usemargin
,top
,left
andright
to center the card. - Also, if you use
max-width
instead ofwidth
, the card will be responsive.
.qrcode-ctnr {
max-width: 250px;
/* width: 250px; */
/* height: 400px; */
/* position: absolute; */
/* top: 0; */
/* bottom: 0; */
/* left: 0; */
/* right: 0; */
/* margin: auto; */
}
- If you want to make the card responsive and the image will be positioned completely on the card, you'd better add
width: 100%
anddisplay: block
for the img in this way:
img {
/* width: 250px; */
/* height: 250px; */
width: 100%;
display: block;
}
Hope I am helpful. :)
Marked as helpful
@zMitchC
Posted
Thank you @ecemgo! Your advice really helped me.
I submit the new solution if you want to check it out :)
@ecemgo
Posted
@zMitchC
I've just checked your new solution. I viewed that you fixed the codes and it is more awesome now :)
I also want to mention about accessibility issue a little bit. Each main content needs to include at least h1
element so you'd better add one <h1>
element in the <main>
tag. If you want, you can replace your <p class="qrcode-title"> Improve your front-end skills by building projects </p>
element with the <h1 class="qrcode-title"> Improve your front-end skills by building projects </h1>
element.
After committing the changes on GitHub and you need to deploy it as a live site. Finally, you should click generate a new report on this solution page to clear the warnings.
Marked as helpful