HTML:
<img src="../_test.jpg" width="200" height="200" alt="Test">
CSS:
img {
border: 0px;
outline: none;
}
答案 0 :(得分:0)
There are javascript solutions to handle broken images.
You could also wrap it in a div and do some tricks(这需要在显示alt
文本之前留出空格,因为“边框”位于img的填充区域内。 但是,仅处理损坏的图片可能有点过分(修改图片路径)。
<强> HTML 强>
<div class="brokenImgBorderKill">
<img src="../_test.jpg" width="200" height="200" alt=" Test">
</div>
<强> CSS 强>
img {
border: 0px;
outline: none;
}
.brokenImgBorderKill {
display: inline-block;
width: 198px;
height: 198px;
overflow: hidden;
}
.brokenImgBorderKill img {
margin: -1px 0 0 -1px;
}
答案 1 :(得分:-1)
img {
border-style:none;
}