简体   繁体   English

删除对象标签周围的白色边框

[英]Remove white border around object tag

I'm currently looking for a way to remove a thin white border around the object tag... heres the code and what I have tried 我目前正在寻找一种方法来删除对象标签周围的白色细边框...这是代码和我尝试过的方法

  .hr-ob { background-color: #003262; width: 50px; height: 10px; border: none; outline: none; border-width: 0; padding: 0; margin: 0; } 
  <div style="background-color: #000000;"> <object border="0" class="hr-ob" data="" type="image/jpg"></object> </div> 

Johnathan's solution was still flawed as I was still getting a border, nevertheless wanted to share the solution I am using now: Johnathan的解决方案仍然存在缺陷,因为我仍处于边界,但仍想分享我现在使用的解决方案:

<iframe class="hr-ob" width="50" height="5" scrolling="no" frameborder="0"></iframe>

.hr-ob {
    background-color: #003262;
    width: 50px;
    height: 5px;
}

Since you have mentioned the type as image/png and the data field is empty there seems to be a default internal-root-color that is appearing. 由于您提到的类型为image / png,并且数据字段为空,因此似乎出现了默认的内部根色。

but when you place an image there is no border. 但是当您放置图像时,没有边框。

The border attribute of <object> is not supported in HTML5. HTML5不支持<object>的border属性。 Use CSS instead. 改用CSS。

CSS syntax: <object style="border:0px"> CSS语法: <object style="border:0px">

 .hr-ob { background-color: #003262; height:100px; width:100px; } 
 <div style="background-color: #000000;"> <object style="border:0px;" class="hr-ob" data="https://dummyimage.com/600x400/4550ed/fff" type="image/jpg"></object> </div> <div style="background-color: #000000;"> <object style="border:0px;" class="hr-ob" data="" type="image/jpg"></object> </div> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM