Giter Club home page Giter Club logo

frontendmentor-qrcode-component's Introduction

Frontend Mentor - QR code component solution

Wassup! πŸ€™

This is my solution to the QR code component challenge on Frontend Mentor.

Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Leia isso em PortuguΓͺs

Table of contents

Overview

Screenshot

My solution

Links

My process

Built with

  • HTML5
  • CSS3

What I learned

As I'm too young in this world and just started to learn HTML and CSS, the hardest for me to do alone was to actually know where to start. πŸ˜…

From my point of view, this challenge is more a CSS challenge than a HTML5 one. My biggest difficulties were about alignment and the interaction between <img> and <div>, as sometimes I was trying to configurate the div's padding and the img popped out of the div.

This was very easy to fix, I simply used the overflow property with the hidden value:

div.window-qr {
  overflow: hidden;
} 

This code hiddes the content that exceeds the div.

I fixed the issue of the img getting off the div, but it still wasn't centered. It kept a left margin and was displaying higher than I wanted. To fix it I setted the img width to 100%.

.window-qr img {
        width: 100%;
}

This made the image occupy only the width of the div.

The last problem I had to solve was how to center my content either horizontally and vertically. This one I really didn't know how to do, but I searched and did found a way that worked. I used the property transform with translate value:

main {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

And I don't really know how this code works, but..

In sum, I think I handled it really good. Well, even if the code isn't the best, the design is pretty close! 🀣

Continued development

I'll keep looking for ways to center things properly because, as I said, I don't know 100% the usability and function of the transform property. But I do know that it's not ok to use a code without knowing how it works. πŸ€·β€β™‚οΈ

Useful resources

Author

Follow me for more "solutions" πŸ˜‰

Acknowledgments

Thanks to @chriscoyier for the post about the transform function. I was 6 by that time! πŸ˜‚

frontendmentor-qrcode-component's People

Contributors

braga-git avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.