@Kamlesh0007
Posted
1.To center a div element on a page, you can use the CSS flexbox layout body { display: flex; justify-content: center; align-items: center; height: 100vh; }
2.As for the image, you can use the CSS max-width property to set the maximum width of an image while allowing it to scale proportionally. do all these things and ur design will be perfect img { max-width: 100%; height: auto; }
body { background-color: hsl(212, 45%, 89%); display: flex; justify-content: center; width: 100vw; align-items: center; height: 100vh; } .code{ width: 280px; }
Marked as helpful
@Asongafac
Posted
@Kamlesh0007 thank you so much. very helpful
@Kamlesh0007
Posted
@Asongafac have u made the changes or not if u have any issues dm me