HTML:
<html>
<body>
<header>
<img class="logo" />
</header>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
CSS:
* {
margin:0px;
padding:0px;
border:none;
}
img.logo {
width:126px;
height:50px;
background-image:url('images/logo.png');
}
Run Code Online (Sandbox Code Playgroud)
每次我尝试为这样的IMG设置样式时会出现一个奇怪的边框.即使我会放置边框:0px; 或边界:无; 在img.logo css中,边界仍然存在.