本网站的第一个菜单项在 IE 中显示不正确,但在 Chrome 中显示正确。我使用 css text-indent 创建一个图像菜单项。
在 chrome 中你可以看到一个房子的图标。在 IE 中,您会看到字母“Sta”。
编辑:我通过给第一个菜单项一个唯一的类名来修复它。
最佳答案
对于 IE 尝试使用 first-child
而不是 first-of-type
.top-menu li:first-child {
text-indent: -1000px;
background-image: url('../image/icon_home.png');
padding-right: 0px;
}
关于css - Chrome/IE CSS 不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17013953/