Design comparison
Solution retrospective
Hey guys.. I have set body height to min-height: 100vh in desktop view and for mobile view i have set height to fit-content; Pls correct me if its wrong.
Community feedback
- @dev-mksinghPosted 9 months ago
Hey @diwakharpandyan good try there, but still there are places you need to improve and also on you question about height here we go:
- Avoid using height until crucial. As setting height can spoil your structure flow and can lead you to specify height of all the elements within container
- The main thing that you need to checkout is responsiveness, if you resize the screen you will find that on screen
630px to 912px
between this the buttons or the structure disturbed. That's because of height thing.
Try to complete this without using height on the body or main, and just use
flex
andrelative-length units
. If still you face issue feel free to ask help;Hope this will is helpful to you. Happy coding
Marked as helpful1@diwakharpandyanPosted 9 months agoThanks @dev-mksingh. It will be helpful if I know on what places other than the height issue I need improvements.
0@dev-mksinghPosted 9 months ago@diwakharpandyan yes sure, see we as developers or aspiring developers, always aims to write less and do more, right? Now as i can see you are
wrapping
every elements in your code, why is that? Some places its redundant , for example this line from your code<div class="title-div"><h1 class="title">SEDANS</h1></div>
Why you have to wrap your
h1
withindiv
? Now because you wrapped it , in styling you would have done additional coding for the layout. Just keep it simple.<h1></h1>
is itself ablock-level element
even if you wont wrap you can simply with help offlex
can use it.Similarly this line:
<div class="info"> Choose a sedan for its affordability and excellent fuel economy. Ideal for cruising in the city or on your next road trip. </div>
Why you used
<div></div>
and not<p></p>
? You must be known tosemantic HTML
.So first make sure you are well known about the elements and
type of elements
you are using, and how to use themoptimally
.I hope i'm clear, and that this is helpful. Enjoy.
Marked as helpful1
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