Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

responsive page using flex box

VISHAL_PANKHADEβ€’ 140

@vishalpankhade

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Do you have any questions about best practices? --->what is the best way to use #id ?, I use class most of the time. and is margin padding setting to 0, a good practice and box-sizing to border-box

Community feedback

Daniel πŸ›Έβ€’ 44,230

@danielmrz-dev

Posted

Hello @vishalpankhade!

Your solution looks great!

I have a couple of suggestions for improvement:

  • First: In order to make your HTML code more semantic, use <h1> for the main title instead of <div>. Unlike what most people think, it's not just about the size and weight of the text.

πŸ“Œ The <h1> to <h6> tags are used to define HTML headings.

πŸ“Œ <h1> defines the most important heading.

πŸ“Œ <h6> defines the least important heading.

πŸ“Œ Only use one <h1> per page - this should represent the main heading/title for the whole page. And don't skip heading levels - start with <h1>, then use <h2>, and so on.

  • Second: Still about semantic HTML, use <main> to wrap the main content instead of <div>.

All these tag changes may have little or no visual impact but they make your HTML code more semantic and improve SEO optimization as well as the accessibility of your project.

I hope it helps!

Other than that, great job!

1

ibrahimmansyβ€’ 60

@ibrahimmansy

Posted

oky @danielmrz-dev

0
ibrahimmansyβ€’ 60

@ibrahimmansy

Posted

oky @danielmrz-dev

0
VISHAL_PANKHADEβ€’ 140

@vishalpankhade

Posted

thank you, @danielmrz-dev for your valuable suggestions, I will keep those in mind and make changes.

1
rayaβ€’ 2,850

@rayaatta

Posted

I forgot,it is better to use IDs fo anchoring purposes then classes for css and js stuff. Checkout this amazing article that explains it all what the id attribute is for

0

VISHAL_PANKHADEβ€’ 140

@vishalpankhade

Posted

thanks, @rayaatta, for sharing this article, I will look into it.

1
rayaβ€’ 2,850

@rayaatta

Posted

Hello VISHAL_PANKHADEπŸ‘‹, Congratulations on completing this challenge πŸŽ‰

To answer your questions. Setting

padding:0;
margin:0;

On the universal selector prevents unexpected results due to default padding and margins by the browser.

2 Setting box-sizing: border-box; is a big plus since you can size items and end up with the actual sizes you declared If you don't declare box-sizing to border-box the browser uses the default which is content box.imagine you set your div to width:100% but you give it some padding inside.it Will overflow its container because it was given a100% width excluding padding and margins.

I hope this helps πŸ™ƒ

If you need any more clarity don't hesitate to ask.

Your solution looks awesome

0
iRaYzEnβ€’ 240

@iRaYzEn

Posted

hay, yeah you should always reset the default behavior with css ,

and it doesn't matter to use classes or ids you can use whatever you want for now

btw checkout naming convention called BEM use it to name things better and you are using a lot of divs to represent paragraphs you should use the <p></p> tag instead

hope you the best

0

VISHAL_PANKHADEβ€’ 140

@vishalpankhade

Posted

thanks @iRaYzEn for suggesting BEM I will try that, actually I didn't get that always reset the default behaviour with CSS, what does that mean?

1
iRaYzEnβ€’ 240

@iRaYzEn

Posted

@vishalpankhade, reset the default behaviour, like reset the padding, the margin, and the box-sizing, and much more you can checkout this modern css reset by the one and only ANDY

you can copy it and past in the other file and link it with html https://andy-bell.co.uk/a-modern-css-reset/ kevin powell approved btw

and go ahead and learn a little bit of js you will find your self enjoying the development process more

happy codding

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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