CSS:内容溢出时底部需要一个float:right按钮
CSS: Need a float:right button to appear at the bottom when content overflows
如何处理按钮 向右浮动 并且当左侧内容溢出时按钮换行的情况,其行为类似于 块元素?
.div-wrapper button { float: right; }
<div class="div-wrapper">
<span> Some data here....(when this text overflows, make button come to the bottom left) </span>
<button>
Redeem
</button>
</div>
我试过使用 flex-wrap: wrap;等。但其中 none 似乎按预期工作:
在这种情况下 flex-wrap: wrap;
应该可以。不需要 float:right
按钮
.div-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
<div class="div-wrapper">
<span> Some data here....(when this text overflows, make button come to the bottom left) </span>
<button>
Redeem
</button>
</div>
如何处理按钮 向右浮动 并且当左侧内容溢出时按钮换行的情况,其行为类似于 块元素?
.div-wrapper button { float: right; }
<div class="div-wrapper">
<span> Some data here....(when this text overflows, make button come to the bottom left) </span>
<button>
Redeem
</button>
</div>
我试过使用 flex-wrap: wrap;等。但其中 none 似乎按预期工作:
在这种情况下 flex-wrap: wrap;
应该可以。不需要 float:right
按钮
.div-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
<div class="div-wrapper">
<span> Some data here....(when this text overflows, make button come to the bottom left) </span>
<button>
Redeem
</button>
</div>