Design comparison
SolutionDesign
Community feedback
- @MelvinAguilarPosted about 2 years ago
Hi @JoseClaudiolima 👋, good job completing this challenge, and welcome to the Frontend Mentor Community! 🎉
Here are some suggestions you might consider:
- Try to use semantic tags in your code. Click here for more information.:
With semantic tags:
<body> <main> <picture> . . .</picture> <div> . . .</div> </main> <body>
- You can use the <picture> tag when you need to change an image in different viewports. Using this tag will prevent the browser from loading both images, saving bandwidth and preventing you from utilizing a media query to modify the image. Update to use it correctly:
Example:
<picture> <source media="(max-width: 812px)" srcset="./images/image-product-mobile.jpg"> <img src="./images/image-product-desktop.jpg" alt="your_alt_text"> </picture>
- For specificity reasons you should work better with classes since they are reusable, and you can leave the ID when you work with Javascript.
- There is no need to have two <h1> elements.
- Instead of using pixels in font size, use relative units of measure like
rem
orem
. The font size in absolute length units (px) does not allow users with limited vision to change the text size in some browsers. Reference. - The
<br>
tag is not a semantic tag, so you should not use it. Also, if a screen-reader reads the text, it will break the flow of reading at the line break tag, so it should be used to add vertical spacing. There are only a few cases where it is necessary (for example, in a poem or an address), and it is possible to avoid them by applying padding and margin styles via CSS. More information here.
You can use flexbox to have two columns without using
margin-left: 308px;
- Add the property
flex: 50%;
topicture
and#info
this way you are creating two columns. More information.
Result:
main { display: flex; flex-direction: row; } picture, #info { flex: 50%; }
I hope those tips will help you.
Good job, and happy coding!
2
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