Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 图像作为Wordpress菜单项在IE中的位置不正确_Css_Wordpress - Fatal编程技术网

Css 图像作为Wordpress菜单项在IE中的位置不正确

Css 图像作为Wordpress菜单项在IE中的位置不正确,css,wordpress,Css,Wordpress,我用一个图像替换了一个菜单项,并使用下面的代码对其进行了样式设置。它在Firefox、Chrome、Safari和Opera中看起来不错,但在IE中它似乎忽略了相对定位 li#menu-item-19 a { display: block; background-image: url('images/logo.png'); background-repeat: no-repeat; width: 124px; height: 120px; text-inden

我用一个图像替换了一个菜单项,并使用下面的代码对其进行了样式设置。它在Firefox、Chrome、Safari和Opera中看起来不错,但在IE中它似乎忽略了相对定位

li#menu-item-19 a {
   display: block;
   background-image: url('images/logo.png');
   background-repeat: no-repeat;
   width: 124px;
   height: 120px;
   text-indent: -9000px;
   margin-right: -42.5px;
   margin-left: -42.5px;
   position: relative;
   top: -31px;
   margin-top: -31px;
   z-index: 1;
}
我不能显示完整的站点,因为它不是实时的,但是我已经设置了一个更简单的版本,在那里我可以复制这个问题


谢谢:)

这是错误,因为您在站点中使用了内联块

试试这个

将DOCTYPE添加到html中


在我添加此内容后,它对我很有用。

此网站为我提供了以下解释:

所以基本上我做的是添加垂直对齐:顶部;对于li元素,我删除了页边空白顶部:-31px;从li#菜单项19 a


我希望这能帮助其他人

谢谢你的努力,但这对我来说不起作用:(顺便说一句,我在IE9上。嘿,我刚从这个网站找到答案