I know it's a basic thing but i never, never, never know how to fit my elements inside the screen, even when the element is just a card like this one. I need some help, please... Thank you all for the patience and advices.
derCalle.exe
@pascal-prfstAll comments
- @engsofjvolfeSubmitted almost 2 years ago@pascal-prfstPosted almost 2 years ago
A realy easy way to center your div/element is for example:
body {display: grid; place-content: center} or body {display: flex; align-items: center; justify-content: center}
But in both cases your body needs a fixed hight and width of 100% or 100vw/100vh
Happy coding
0 - @burak2482Submitted almost 2 years ago
Hi, its my first challenge.
I couldn't find the right way to how can i set mobile width and desktop width for the project. I tried some technics but it didn't work.
How can i set mobile width and desktop width for page?
Thanks for everything!
@pascal-prfstPosted almost 2 years agoHallo Burak,
to set the size of elements for different screen size you can use a me media queries.
Here is an example:
@media (max-width: 375px) { .card { width: 200px; } }
In that case the witdh of your .card container will only be 200px under 375px. When working with sizes you could use rem instead of px.
Overall the rest is looking good
Marked as helpful1 - @Grill3dCheeseSubmitted about 2 years ago
Hello! Just curious on the structure of my HTML. I did a div for the container and one div for the card which contains all of the elements within the card (image, h1 and paragraph tags) - is this the right way to structure the card? Or should the image have been in one div and the h1 and paragraph tags in another div? Overall, it worked in the end, but I wasn't sure if there are better practices to follow. Thank you!
@pascal-prfstPosted about 2 years agoMaybe you can put the container div into <main> tag and the attribution tag into a <footer> tag. Everything else looks solid.
Happy coding
1 - @pascal-prfstSubmitted about 2 years ago@pascal-prfstPosted about 2 years ago
Could need feedback. When I check the design on mobile the top and bottom get chopped and I don`t realy know what I am doing wrong.
0