[英]w3-CSS append newline when content width greater than viewport width in div with inline-flex
I'm appending a bunch of boxes with w3-card into this div:我将一堆带有 w3-card 的盒子附加到这个 div 中:
<div id="myClasses" class="w3-container" style="display: inline-flex;">
Here's where I append it:这是我 append 的位置:
myclasses.append([
$('<div/>', {"class": "w3-card button", "onclick": "enterThisClass(" + e + ")"}).append([
$('<h3/>').text(snapshot.val().name)
])
])
This works ok, but when I have too many boxes side by side, they just squish together and hide the ones over the edge.这工作正常,但是当我并排放置太多盒子时,它们只会挤压在一起并将它们隐藏在边缘上。 How would I make it so it wouldn't squish nor go over the edge, but rather make a new line?
我将如何做到这一点,这样它就不会压扁 go 边缘,而是换一条线?
try adding width to the dynamic div.尝试向动态 div 添加宽度。 Like 20%.
比如 20%。 So when you append 5 div's.
所以当你 append 5 div 的时候。 The 6th div will auto shift below.
第 6 个 div 将在下方自动移动。 Try
尝试
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.