【发布时间】:2020-08-24 21:16:51
【问题描述】:
我无法移除边框。
这是我的代码:
<mat-grid-list cols="2" rowHeight="2:1">
<mat-grid-tile>
<button mat-raised-button>1</button>
<img id="image-diamond"/>
</mat-grid-tile>
</mat-grid-list>
还有css:
button{
width: 80%;
height: 70%;
padding: 20px 40px;
font-size: 32px;
font-family: Arial, sans-serif;
display: inline-block;
background: linear-gradient(to right, #070600 0%, #f7d931f3 50%, #fae901f3 50%, #f7ef8bf3 100%);
background-size: 200% 100%;
background-position: 100% 0;
transition: background-position 0.3s;
opacity: 70%;
border: 1px solid #f00;
position: relative;
z-index: 1;
}
#image-diamond{
height: 20%;
width: 10%;
margin-top: 35%;
position: relative;
z-index: 2;
right: 5%;
overflow:hidden;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
并且图像有额外的边框。设置背景透明或边框没有任何变化。在 0px 上设置粗 也没有改变任何东西,当创建边框时,第二个边框仍然可见,我可以看到 2 个边框。
当我设置border: 2px solid red; 时,我可以看到白色和红色边框。
【问题讨论】:
-
可能是轮廓。尝试将大纲设置为无,如下所示:大纲:无;
-
@carlos.gmz 不幸的是,它没有帮助。
-
如果需要去除黑红边框,那么看我的解决方案
-
我自己测试过,没有白色边框。可能会改变测试条件,例如浏览器。