I’m fairly new to coding (started about a month ago with going through FCC courses) with zero prior experience. I figured I should finally stop neglegting technologies and rather embrace them and learn how to work with them.
It’s just short and simple - nothing too fancy, - but I suppose we all have to start somewhere?
I’m keen to learn more and improve, as this is a great challenge for me and I love figuring out how everything works and how to put bits and pieces together to make the code work. I’ll be gratefull for any comment or feedback from you guys.
Cheers
PS: I’m not overly confident when it comes to making images and other content responsive and maybe generally using different units (%, px, rem, em etc.) when coding. As I’ve never really encountered them before, still ocasionally strugling to get my head around it. If you have any tips/advice/tricks to get hang of this, fire away!
This way, you’re telling the image container to get as wide as the viewport, and to also center all text elements inside it. CSS applies text-align: center; to images too.
Then, you tell the image that it should get as wide as its container, but only to a maximum width of 811px. So, the image will be 811px, but if you’re seeing it from a smaller device, it will perfectly fit the viewport, making it responsive.
I’ve sorted the body tag, but got stuck sith the image. The change you recommended visibly seems to be working, but it no longer pass the FCC test for responsiveness. The text-align: center doesn’t seem to be working for me for some reason, so I used margins on both sides and it passed. I’ll definitely take a better look at it to try to understand what’s happening there.