@bhautik1206Submitted over 2 years ago
while building this product my problem is that it hard for align the box I think the css part is unsure about no i do not have any question
while building this product my problem is that it hard for align the box I think the css part is unsure about no i do not have any question
Hi, let me recommend you this code for changing the image depending the screen's size:
<picture> <source srcset="desktop.jpg" media="(min-width: 1024px)"> <source srcset="tablet.jpg" media="(min-width: 768px)"> <source srcset="mobile.jpg" media="(min-width: 377px)"> <img src="mobile.jpg" alt="Main Image"> </picture>
And for alignment of the box... you can do something like this:
<main> <div class="box"> ... </div> </main>
And you give the main element a display of flex, align-items of center. That's it! (You can also give the box div a margin of auto) I hope that works! Good luck