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

Why does my flex item ignore flex-shrink: 1 and overflow its container when it contains a long string?

$
0
0

.container {  display: flex;  width: 200px;}  .item {  flex: 1; /* Should shrink, right? */  background: lightblue;}
<html><body><div class="container">  <div class="item">Large content. Large content. Large content. Large content. Large content. Large content. Large content.</div></div></body></html>

Problem: The .item box keeps expanding, making the container larger than 200px. I expected it to wrap. Why is this happening?


Viewing all articles
Browse latest Browse all 1675

Trending Articles



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