如何将子 div 内容放入父 div。这样即使我放大屏幕,子div也不会从父div中出来。
<div>
<div title="childDiv" style="width:auto;">
<h3 class="headerwidth" style="margin-top:1px; margin-bottom:0px"> Test:</h3>
Welcome to the this new page test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
</div>
我试过溢出:隐藏但不起作用
最佳答案
<style>
p {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<div>
<div title="childDiv">
<h3 class="headerwidth"> Test:</h3>
<p>Welcome to the this new page test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
</p>
</div>
</div>
希望我明白你的问题。
https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow
关于html - 即使在放大后如何将子内容放入父 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50358484/