I am having trouble with my CSS setup. I have an outer container that wraps around an inner container, which in turn contains two divs. The inner container has a display property of flex, but for small screen sizes, I want the two divs to stack up and display block instead. I tried using media queries to achieve this, but it's not working as expected. Can anyone help me understand what I'm doing wrong? Also, when should I give a max-width to my image?
.row2{
display: flex;
padding:2em 3em;
}
.outercontainer{
background-color: darkgray;
}
@media (min-device-width: 426px) and (max-device-width: 764px) and (-webkit-min-device-pixel-ratio: 2) {
.row2{
display: block;
padding: 0.1em;
}
.image2{
width: 100%;
}
}
<div class="outercontainer">
<div class="innercontainer row2">
<div class="col text">
<h3>title text</h3>
<p>This is simple test text This is simple test text This is simple test text This is simple test text This is simple test text This is simple test text</p>
</div>
<div class="col image">
<img class="image2" src="https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixid=MXwxMjA3fDB8MHxzZWFyY2h8Mnx8bmF0dXJlfGVufDB8fDB8&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60" />
</div>
</div>
</div>