html - html中两个图像之间令人讨厌的黑线
问题描述
我遇到了一个问题,我的 html 页面存在一条黑线,但我没有任何代码
我用红线在上面画了一个圆圈的部分。有一条黑线。这是我的html代码。
<div class="mid">
<a href="@Url.Action("WesternCuisine", "Home")">
<img src="~/Image/western_cuisine.png" style="width: 40%; height: 40%;" />
</a>
<a href="@Url.Action("ChineseCuisine", "Home")">
<img src="~/Image/chinese_cuisine.png" style="width: 40%; height: 40%;" />
</a>
<div class="cfc-container">
<h1 class="main-caption"> Your precious <br /> Feedback is our <br /> Motivation to be better <br /><button type="button" class="main-button" onclick="window.location.href='/Home/Feedback';"><strong>Learn More</strong></button> </h1>
</div>
</div>
还有我的 CSS 代码
.mid {
margin-top: 0px;
flex-wrap: wrap;
justify-content: center;
text-align: center;
}
.cfc-container {
display: inline-block;
width: 80%;
padding-top: 30px;
padding-bottom: 30px;
margin-top: 5px;
margin-bottom: 30px;
color: inherit;
border: 1px solid;
background-color: white;
background-image: linear-gradient(to right,rgba(228,241,254,1),rgba(255,255,255,0.2)), url(../Image/customer_service.png);
background-repeat: no-repeat;
background-position: right;
}
我不知道如何删除那条黑线,即使我做border: none
也不能。
解决方案
这是因为标签的默认行为 - 文本装饰,
.mid a {
text-decoration: none;
}
.mid {
margin-top: 0px;
flex-wrap: wrap;
justify-content: center;
text-align: center;
}
.mid a {
text-decoration: none;
}
.cfc-container {
display: inline-block;
width: 80%;
padding-top: 30px;
padding-bottom: 30px;
margin-top: 5px;
margin-bottom: 30px;
color: inherit;
border: 1px solid;
background-color: white;
background-image: linear-gradient(to right,rgba(228,241,254,1),rgba(255,255,255,0.2)), url(../Image/customer_service.png);
background-repeat: no-repeat;
background-position: right;
}
<!DOCTYPE html>
<html>
<body>
<div class="mid">
<a href="@Url.Action("WesternCuisine", "Home")">
<img src="https://thewindowsclub-thewindowsclubco.netdna-ssl.com/wp-content/uploads/2018/01/Password-Spoofing.jpg" style="width: 40%; height: 40%;" />
</a>
<a href="@Url.Action("ChineseCuisine", "Home")">
<img src="https://thewindowsclub-thewindowsclubco.netdna-ssl.com/wp-content/uploads/2018/01/Password-Spoofing.jpg" style="width: 40%; height: 40%;" />
</a>
<div class="cfc-container">
<h1 class="main-caption"> Your precious <br /> Feedback is our <br /> Motivation to be better <br /><button type="button" class="main-button" onclick="window.location.href='/Home/Feedback';"><strong>Learn More</strong></button> </h1>
</div>
</div>
</body>
</html>
推荐阅读
- android - 应用未设置:此应用仍处于开发模式,Facebook UI 更改
- excel - Excel 从非连续单元格中查找中位数并忽略 0 值
- angular - 在Angular7中将图像(来自外部库)保存到本地的PDF文件?
- jquery - 通过函数将`this`作为变量与jquery传递
- django - 模型可以有 ForeignKey 对象的列表吗?
- java - Spring Batch Partition 无法按预期工作
- python - python中的for循环在执行中被阻塞
- java - Jersey:如何在服务器端获取 POST 参数?
- github - 如何获取托管在 Github 上的所有 C++ 项目的列表?
- java - Servlet 异常映射