Design comparison
Solution retrospective
Q:What did you find difficult while building the project? A:Anything because I've just started.. Q:Which areas of your code are you unsure of? A:All... I mean.. I m pretty sure it could be done better... Q:Do you have any questions about best practices? A:How should I name all the elements/class(Html).
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there ๐. Good job on completing the challenge !
I have other suggestions about your code that might interest you.
- You can use BEM naming convention to name the classes.
HTML ๐:
- Use semantic elements such as
<main>
and<footer>
to improve accessibility and organization of your page.
- The <br> tag is often used to create line breaks, but it doesn't convey any semantic meaning. When a screen-reader reads the text, it will break the flow of reading at the line break tag, which can be confusing for users. More information here.
- Since this component involves scanning the QR code, the image is not a decoration, so it must have an
alt
attribute. Thealt
attribute should explain its purpose. e.g.QR code to frontendmentor.io
I hope you find it useful! ๐
Happy coding!
Marked as helpful1 - @HassiaiPosted almost 2 years ago
Replace <div class="post"> with the main tag and <p class="titlep"> with <h1> to fix the accessibility issues. click here for more on web-accessibility and semantic html
Wrap
* Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>. Coded by <a href="#">Vasiliu Ilie-Cristian</a>.</p>*
in a footer tag and is should be out of <div class="post">.Add the alt attribute
alt=" "
to the img tag to fix the error issue. The value of the alt attribute is the description of the image.To center .post on the page , add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
To center .container on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
To center .container on the page using grid: body{ min-height: 100vh; display: grid; place-items: center; }
There is no need to give .post a box-shadow value, position absolute and its properties and a margin value.
For a responsive content, replace the width in .post with a max-width value and there is no need for a height value.
Give h1 and p the same font-size of 15px and the same margin-left, margin-right and margin-top values. Give p a margin bottom value.
Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord