html - 即使在放大后如何将子内容放入父 div

标签 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>

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

最佳答案

<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

关于html - 即使在放大后如何将子内容放入父 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50358484/

相关文章:

javascript - 将对象标签的数据属性更改为 SVG 文件

javascript - 大小以适合 Canvas 上的字体

css - 垂直居中内容的全屏高度

css - Bootstrap : How to deal with iMac vs typical laptop sizes?

javascript - 我哪里出错了 - JAVASCRIPT

javascript - super 简单的音频播放器吗?

javascript - $.getJSON 结果转为 html

html - 是否可以使用剪辑隐藏 CSS 背景 Sprite 图像的特定区域?

html 在 2 列布局中居中和调整图像大小

html - 使用 Bootstrap 4 将标签元素内的图标定位到右侧