即使放大后,如何在父div中放入子内容

时间:2018-05-15 20:12:38

标签: html css bootstrap-4

如何在父div中包含子div内容。因此即使我放大屏幕,孩子div也不会从父div中出来。

<div>
            <div title="childDiv"  style="width:auto;">
                <h3 class="headerwidth" style="margin-top:1px; margin-bottom:0px"> &nbsp;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>

我试过溢出:隐藏但不起作用

1 个答案:

答案 0 :(得分:0)

<style>
  p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
</style>
<div>
  <div title="childDiv">
    <h3 class="headerwidth"> &nbsp;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