html - 即使在放大后如何将子内容放入父 div 中
问题描述
如何在父 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
推荐阅读
- flutter - 期望一个班级成员。:19
- phpspreadsheet - 使用 PhpSpreadsheet,如何为整个工作表(而不是整个电子表格)设置样式
- apache-flink - 如何定期将流的统计信息发送到 Flink 中的另一个流
- python - json 文件中的分组值
- amazon-web-services - VMWare 虚拟机到 AWS/Azure 的迁移
- hibernate - 使用 Hibernate Validator 进行实体验证的问题
- javascript - 如何获得价值 2 Calc 函数
- r - 在闪亮的应用程序中将背景图像包含到一个选项卡中
- java - 如何在我的 Spring Boot 项目目录中创建日志文件?
- python - 如何迭代 QTableWidget 中的列并检查是否选中了复选框?