What is the standard practice for displaying just cards in the center of a page? Specifically referring to HTML elements & structure used to make this happen
generieyyc
@generieyycAll comments
- @kayleighpengSubmitted over 1 year ago@generieyycPosted over 1 year ago
Hello! I'm sharing the feedback i got before.
For proper centering the container (whole card) vertically and horizontally, you can use code as:
body { min-height: 100vh; display: grid; place-content: center; }
Hope that helps!
0 - @Alt08Submitted over 1 year ago
with some defects that I can not solve.
I don't know how to apply that purple color to the image.
I appreciate any suggestion.
@generieyycPosted over 1 year agoHello!
I am not sure if this is the right way of doing it but as a workaround for me, I set my main container with the purple background and then set the img opacity to 0.5. Hope it works out for you.
1 - @crixferSubmitted over 1 year ago
Centering and putting the image aside of the white box, then centering the text in the right-sided white box.
I tried adding Bootstrap coding, but it broke my codes every time. I need more practice.
What do you recommend to do these kinds of positioning and sizing without using so many codes? I really appreciate any help you can provide.
@generieyycPosted over 1 year agoHello! I'm sharing the feedback i got before.
For proper centering the container (whole card) vertically and horizontally, you can use code as:
body { min-height: 100vh; display: grid; place-content: center; }
Hope that helps!
Marked as helpful1