如何禁用IE 10中的图像边框

时间:2013-09-14 21:08:32

标签: html css internet-explorer-10 css3

如何禁用我的图像边界线以及Internet Explorer 10中标记中的图像?我试过了:

 a {
outline : none;
text-decoration: none;
 }
 a img {
 border : 0;
outline : none;
 }
 img {
border : 0;
border-style: none;
 }

还有这个:

 <meta http-equiv="x-ua-compatible" content="IE=edge" />

和此:

 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">

没有任何作用。我的想法已经不多了。请有人帮帮我吗?

编辑:这是我的html和css文件:

 <!doctype html>
 <html>
 <head>
    <meta charset="utf-8" />

<title> Title </title>
<link rel="stylesheet" href ="main.css" />
<link rel="stylesheet" href ="menu.css" />

 </head>

 <body>

 <div class = "page " align ="center">
    <div class="header">
                <img id="bannerimg">
                <img id="menubar">
    </div>

    <div class="menu">
        <table id="menubtns" border="0">
        <tr>
            <td><a href =""><img id="projekt"></a></td>
            <td><a href =""><img id="eshop"></a></td>
            <td><a href =""><img id="foto"></a></td>
            <td><a href =""><img id="video"></a></td>

        </tr>
        </table>
    </div>

    <div class= "content">
        <table id= "obsah" border="0">
        <tr>
            <td><a href =""><img id="buybtn"></a></td>
            <td> dátum: XX.XX.XXXX </td>
            <td><a href =""><img id="buybtn"></a></td>
            <td> dátum: XX.XX.XXXX </td>
        </tr>   
        <tr>
            <td><a href =""><img id="buybtn"></a></td>
            <td> dátum: XX.XX.XXXX </td>
            <td><a href =""><img id="buybtn"></a></td>
            <td> dátum: XX.XX.XXXX </td>
        </tr>       
        <tr>
            <td><a href =""><img id="buybtn"></a></td>
            <td> dátum: XX.XX.XXXX </td>
            <td><a href =""><img id="buybtn"></a></td>
            <td> dátum: XX.XX.XXXX </td>
        </tr>
        <tr>
            <td><a href =""><img id="buybtn"></a></td>
            <td> dátum: XX.XX.XXXX </td>
            <td><a href =""><img id="buybtn"></a></td>
            <td> dátum: XX.XX.XXXX </td>
        </tr>
        </table>
    </div>

    <div id= "partneri"></div>
    <div id= "footer">Copyright.</div>


 </div>     
 </body>
 </html>

主要CSS:

 body {
 background-image:url('img/bg_image.png');
 background-repeat:no-repeat;
 margin: 0;
 }
 a img
 {
 border: 0px;
 }

 .header #bannerimg
 {
 background-image:url('img/banner.png');
 width: 1040px;
 height: 594px;
 background-repeat:no-repeat;
 outline: none;
 }

 .content
 {
 margin-top: 80px;
 margin-right: 50px;
 font-family: "Verdana";
 font-size: 20px;
 position: relative;
 }

 .content #buybtn
 {
 background-image:url('img/kupit.png');
 height: 36px;
 width: 140px;
 }

 .content #obsah
 {
 border-spacing: 60px 30px;
 }

 #partneri
 {
 background-image:url('img/partneri.png');
 height: 142px;
 width: 1012px;
 }

 #footer {
 width: 992px;
 margin-top:5px; 
 padding:15px 0; 
 text-align:center; 
 font-size:12px; 
 font-family:arial; 
 color:#FFF; 
 background:#000; 

}

MENU CSS:

 .menu
 {
 margin-top: -110px;
 margin-right: 10px;
 z-index: 2;
 position: relative;
 }

 .header #menubar
 {
 background-image:url('img/menu1.png');
 height: 121px;
 width: 992px;
 position: relative;
 margin-top:-49px;
 margin-right: 20px;
 z-index: 1;
 }

 .menu #menubtns
 {
 border-spacing: 135px 5px;
 }

 .menu #projekt
 {
 background-image:url('img/projekt.png');
 height: 37px;
 width: 184px;
 }

 .menu #eshop
 {
 background-image:url('img/eshop.png');
 height: 37px;
 width: 100px;
 }

 .menu #foto
 {
 background-image:url('img/foto.png');
 height: 37px;
 width: 76px;
 }

 .menu #video
 {
 background-image:url('img/video.png');
 height: 37px;
 width: 92px;
 }

border / outline around my images

2 个答案:

答案 0 :(得分:11)

只需设置边框:

a img{
    border: 0px;
}

适用于IE10 的 Simple Working DEMO
Your Code Working DEMO

答案 1 :(得分:1)

我遇到了这个,因为图像是使用css background-image指定的,而img元素没有src。将img标签src设置为透明png使其在IE 10中可以像在其他浏览器中一样工作。

desktop app

免责声明:浏览器嗅探很糟糕。