html - 覆盖自身的标题元素
问题描述
我总是遇到标题文本覆盖自身的 CSS 问题,如下所示:
CSS:
h3{
font-family: 'Girassol', cursive;
font-size: 40px;
line-height: 1px;
word-break: break-all;
text-overflow: ellipsis;
}
html
<h2 className="home-product-topic-h2">Our Products</h2>
<h3 >
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
</h3>
我怎样才能让它正确包装?
解决方案
删除line-height:1px
:
h3 {
font-family: 'Girassol', cursive;
font-size: 40px;
word-break: break-all;
text-overflow: ellipsis;
}
<h2 className="home-product-topic-h2">Our Products</h2>
<h3>
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
</h3>
推荐阅读
- android - 从浏览器打开 Intent url
- react-native - 混合 JavaScript 移动开发 - Apache Cordova vs Capacitor with Ionic vs NativeScript vs React Native
- ios - SwiftUI 创建列表
- javascript - 如果通过 jquery 动态添加,我的 Html Toggle/Switch 无法正确呈现
- php - Redis 比 MySQL 慢
- r - 如何删除此 for 循环
- c - AVX2 和 SSE2 的位向量运算
- python - 如何在python中对图像的某个部分进行切片?
- drupal-7 - 相关内容——不显示当前节点
- excel - 如何更改到下一行?