gpt4 book ai didi

html - 如何去除图片的边框?

转载 作者:太空宇宙 更新时间:2023-11-03 21:15:12 27 4
gpt4 key购买 nike

我在 StackOverflow 上发现了很多像我这样的问题 example1 example2但由于未知原因,我的图像周围仍然显示了一些边框:

enter image description here

 .imgCadenas{
width: 50px;
height: 50px;
background: url('/cadenas.png');
background-repeat: no-repeat;
background-position: right;
background-size: 100%;

border:0;
border-style: none;

position: absolute;
right: 150px;
top: 5px;
}

有人有解决方案吗?

[编辑] 根据你的建议,我在浏览器中有这个 CSS: enter image description here

.liMachine {
list-style-type: none;
border-style: solid;
margin-bottom: 5px;
word-break: break-all;
position: relative;

}

.imgCadenas{
width: 50px;
height: 50px;
background: url('http://icons.iconarchive.com/icons/paomedia/small-n-flat/256/sign-check-icon.png');
background-repeat: no-repeat;
background-position: right;
background-size: 100%;

border: 0 !important;
border-style: none !important;
outline: none !important;
display: block;

position: absolute;
right: 250px;
top: 5px;
}

.whoLock{
position: absolute;
right: 15px;
top: 10px;
}
<li class="liMachine switch">
<div id="nameMachine">
<h3>My machine</h3>
</div>
<div id="stateMachine">
State:<span class="state">running</span>
</div>
<div>
<img class="imgCadenas">
<p class="whoLock">Locked by: StackOverflow</p>
</div>
</li>

最佳答案

尝试这样修改:

.imgCadenas{
width: 50px;
height: 50px;
background: url('/cadenas.png');
background-repeat: no-repeat;
background-position: right;
background-size: 100%;

border: 0 !important;
border-style: none !important;
outline: none !important;

position: absolute;
right: 150px;
top: 5px;
}

已编辑

您的 img 元素缺少 src 属性,尝试将 img 元素更改为 div 元素。

另见: https://stackoverflow.com/a/22097004/4964262

关于html - 如何去除图片的边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43089826/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com