I personally found replacing the image on screen resize from mobile to desktop a huge challenge. Finally used the 'display: none' property and it worked. Feel free to let me know if there's any other way I could've done it. Also, I'd appreciate feedbacks on the design in general.
Carmen Delber
@CarmendelberAll comments
- @ChibuzorIsaacSubmitted about 2 years ago@CarmendelberPosted about 2 years ago
Hey! you can also use the image as background of a div in css and then change the image on the desktop media query:
div { background: url('../images/image-product-mobile.jpg') center; background-size: cover; }
But I think the solution of
picture
would be more correct in terms of accesibility and semantics.Marked as helpful1 - @Snorri967Submitted about 2 years ago
I found it difficult to align the current price and old price design until I found out that it would be easy by putting the elements in a table data cell and adding display : table-cell; to the stylesheet.
@CarmendelberPosted about 2 years agoHey! You can use flexbox to align both prices too:
<div class="card__prices"> <p class="price-main">$149.99</p> <p class="price-deleted">$169.99</p> </div>
You need to add
display:flex;
andalign-items:center;
to the parent card__pricesMarked as helpful1 - @lealee92Submitted about 2 years ago@CarmendelberPosted about 2 years ago
Hey! to center content easily, add 'display: flex;' and 'height: 100vh;' on the parent container (body) and 'margin: auto;' on the child (.container).
0