@kkulek
Posted
@andredomin congrats on delivering your first project here!!
Great start and if you would like to finish next project better try:
- Review materials on box-model
You're have such a pain with margins/paddings etc., because your component doesn't have a proper fundamentals.
Try to focus on: a) set a body on 100vh (100 viewport height = 100% of screen height, no matter if mobile or desktop)
and display elements inside of a body as flex: display: flex; flex-direction: column; (in this case no matter what you set - you'll have 1 container in the body) align-items: center; justify-content: center;
now you have fundations for the your component (it will be in the perfect center)
b) create container with proper width and height (invicible box for rest of a content) f.e.:
<div class=container> -> here will be all the content: img, headline, copy etc. </div>display content in this container with proper values, for example: display: flex; flex-direction: column; (this is important in your case: every item will be below previous) align-items: flex-start; justify-content: space-around (you'll have almost everything done in your "invincible box")
c) You can add a small padding for the copy if you want a pixel perfect delivery. And you're a one step closer to deliver next project a bit better :)
- Create components/webistes from the ground up. start with mobile and just add in bigger resolutions (@media) changes.
This way you avoid situation that a @media query for smaller resolution overrites many lines of code.
You can check code for this component of mine: site: https://kkulek.github.io/simple-nft-preview-card-component/ code: https://github.com/kkulek/simple-nft-preview-card-component
Maybe this will help you a bit.
PS. If you review informations about box model and basic flex, you start setting up projects with proper fundamentals - with them you will not have to hustle so much with margins ;)
Marked as helpful
@andredomin
Posted
@kkulek Thank you so much, it is a pleasure to receive this help when one is just starting out. I take note of everything you have told me!
@kkulek
Posted
@andredomin good luck Andrés! I'm a begginer too and I'm sure here is a greate place for practice and supportive community.
freecodecamp.org may be a great source of structured content (good quality & free)
I wish you patience and just keep eyes on the prize! Creating front-end on the good level is hard.
But humble attitude with solid work each day can help us improve :).
Study hard, each day a bit better...