I wanted to move my image div which is originally on the left side of my webpage to the top of the page when the window resizes reaches to a certain width. Using html css and javascript
.image{
display: flex;
justify-content: center;
align-items: center;
width: 55vw;
height: 100vh;
background: url("signup.jpeg") no-repeat;
background-size: cover;
background-size: 55vw 100vh;
@media screen and (max-width: 768px) {
.image{
width: 100%;
height: auto;
flex-wrap: wrap;
width: 90vh;
background-size: cover;
}
}
2
Answers
css
By using the order property along with flexbox and media queries, you can control the order and layout of elements based on different screen sizes.
several small problems in your code no closing }, double width…
as saying Andy, flex is not necessary
just put the image position absolute in body