CSS Flexbox宽度宽度溢出100%
我有两个问题:
1。)如何使黄色框更宽,即使长话长。有了“计算”,它将起作用,但这对我来说似乎不安全。还有另一个解释宽度自动的解决方案吗?
2.)制作输入文本包装的最安全方法是什么?
---
<style>
.container {
width: 300px;
background-color:#0f0;
display: flex;
}
.left {
width:200px;
background-color:#f00;
}
.right {
width:100%;
background-color:#ff0;
}
</style>
<div class="container">
Container 300px
</div>
<div class="container">
<div class="left">
This text.
</div>
<div class="right">
This is a prettyveryveryveryveryveryveryveryveryveryveryveryverylong word.
</div>
</div>
---
I have two problems:
1.) How do I get the yellow box to not be wider than the parent flexbox even with long words. With "Calc" it would work, but that seems unsafe to me. Is there another solution that the width is automatically?
2.) What is the safest way to make the entered text wrap?
---
<style>
.container {
width: 300px;
background-color:#0f0;
display: flex;
}
.left {
width:200px;
background-color:#f00;
}
.right {
width:100%;
background-color:#ff0;
}
</style>
<div class="container">
Container 300px
</div>
<div class="container">
<div class="left">
This text.
</div>
<div class="right">
This is a prettyveryveryveryveryveryveryveryveryveryveryveryverylong word.
</div>
</div>
---
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)