css - 图像超出屏幕并在底部创建滚动条
问题描述
我被困在一个问题上。我用这段代码添加了 img :
HTML:
.homepage-right {
position: absolute;
right: 0;
top: 46em;
}
.river-right {
padding: 0;
}
.img-river-right {
float: right;
max-width: 50%;
-ms-transform: rotate(1deg); /* IE 9 */
-webkit-transform: rotate(1deg); /* Safari 3-8 */
transform: rotate(1deg);
}
<section id="homepage-river-right">
<div class="homepage-right">
<div class="col-md-12 river-right">
<img class="img-river-right" src="https://images.unsplash.com/photo-1490644120458-f5e5c71d2ab0?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80">
</div>
</div>
</section>
问题是底部的滚动条。我知道她为什么会出现,因为我旋转了img,她超出了屏幕的右侧。我的问题是如何剪切 img 以不创建此滚动条。或者我不能在 CSS 中,我需要在 photoshop 中使用完美的 img 来做到这一点。
谢谢。
解决方案
添加overflow
hidden
_.river-right
.river-right {
padding: 0;
overflow:hidden;
}
推荐阅读
- python - 使用 Pyinstaller 打包 Python 程序 Exe 后未运行
- python - 一行if语句的条件表达式
- sql - PRESTO MAP_FROM_ENTRIES 和 CROSS JOIN UNNEST
- sql - 如何根据同一表中先前列中的值设置标志?(甲骨文)
- c# - 阻止用户回复消息
- angular - mat select 在移动网络上很粘
- azure-pipelines - Azure 管道,最后阶段被跳过,我不明白为什么!是否有审批限制或时间限制?
- puppeteer - 从 puppeteer 中识别相等的字段
- javascript - 以不同的间隔显示图像
- c++ - 添加新模块实例时 V8PP / V8 崩溃