css - 位于具有相同宽度的图像上方的 div 周围的暗线
问题描述
我有一张带有背景图片的卡片。此卡片中有一个 div,其宽度设置为,100%
但您仍然可以稍微看到 div 两侧的背景图像。我已经删除了,box-shadow
以便您可以更好地看到问题。
/*This is the main card*/
.card
{
width: 465px;
height: 700px;
display: inline-block;
position: relative;
/*box-shadow: 3px 3px 5px #D5D5D5;*/
border-radius: 15px;
}
/*This assigns the background image to the card*/
.card:nth-Child(1)
{
margin-right: 30px;
background-size: 100%;
background-image: url('images/daniel-malikyar-F1leFzugQfM-
unsplash.jpg');
}
/*This is the rectangular div positioned at the bottom of the card*/
.cardContentContainer
{
width: 100%;
height: 350px;
bottom: 0;
overflow: hidden;
position: absolute;
background-color: white;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
}
我尝试给内容容器一个1px
白色边框,但线条仍然可见。
解决方案
不要重复边界半径。这就是这些文物的原因。
.card
{
...
border-radius: 15px;
overflow: hidden;
}
border-radius-*
并从中删除.cardContentContainer
同时删除left: 50%
和transform
推荐阅读
- sql - 如何在单列中的两个字符串之间换行?
- php - 使用php在三个下拉选定值上上传文件
- c# - SQL查询填写backgroundworker后数据表不显示信息
- html - 引导类“d-sm-none”的 div 显示在每个屏幕尺寸上
- c++ - TCP客户端服务器程序
- r - 如何将包含month_year的字符列表转换为字符向量
- javascript - Express.js 中间件可以依赖链中先前的中间件吗?
- macos - Supervisord - 如何在文件路径中使用带有空格的命令
- python - 如何使用 scrapy 和 pyinstaller 在 Windows 10 中创建单个可执行文件?
- angular - 关闭或提交后如何丢弃或清除 MatDailog 数据