Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1675

trying to have a responsive design for the items using media query and flexbox , but it is not working

$
0
0

.container {  display: flex;  justify-content: center;  align-items: center;  flex-wrap: wrap;  flex-direction: column;}.item {  margin: 10px;  border: 1px solid lightgray;  border-radius: 10px;  overflow: hidden;  width: 100%;}@media screen and (min-width:700px) {  .item {    width: 50%;  }  .container {    flex-direction: row;  }}
<div class="container"><div class="item">content</div><div class="item">content</div></div>

I was expecting a responsive design that when the screen is under 700px, the items should be columnar and when the screen is wider than 700px, the items should be in a row and their width should be 50%. However, it looks like just width: 50%; is applying.

This is the image:
enter image description here


Viewing all articles
Browse latest Browse all 1675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>