css - Chrome/IE CSS 不兼容

标签 css internet-explorer google-chrome

本网站的第一个菜单项在 IE 中显示不正确,但在 Chrome 中显示正确。我使用 css text-indent 创建一个图像菜单项。

http://test.suntliv.nu/

在 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/

相关文章:

html - margin + ? = flexbox 中的 100% 宽度

html - IE/Edge 上的左省略号溢出

html - 缩进罗马列表中的段落

javascript - .removeClass 用于多个缓存选择器

css - IE 9 不渲染 CSS 过渡。我有什么错吗?

javascript - IE9 - 添加和删除 DOM 元素会破坏父 keydown 事件

css - 悬停链接有时会触发奇怪的鼠标指针行为

JavaScript异常: "not well-formed" on firefox browser and "XMLHttpRequest.." error on chrome browser

html - ttf 文件无法在 Chrome 和 Firefox 上呈现

javascript - JQuery 设置 Div 样式 After Effect