Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.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 Chrome和Safari之间一个像素的水平偏移量,带有绝对定位元素_Css_Google Chrome_Safari_Css Position - Fatal编程技术网

Css Chrome和Safari之间一个像素的水平偏移量,带有绝对定位元素

Css Chrome和Safari之间一个像素的水平偏移量,带有绝对定位元素,css,google-chrome,safari,css-position,Css,Google Chrome,Safari,Css Position,我的下拉菜单使用以下CSS: header nav ul #sublist { height: 98px; width: 166px; position: absolute; left: 155px; top: 381px; z-index: 1; } 出于某种原因,该位置在Safari下方再向右一个像素。它看起来正是我希望它与铬 我一直在调查,找不到偏移量的来源。你可以在这里看到我的网站: 下拉菜单位于导航栏上的“外籍教练”下。在父li元素上

我的下拉菜单使用以下CSS:

header nav ul #sublist {
    height: 98px;
    width: 166px;
    position: absolute;
    left: 155px;
    top: 381px;
    z-index: 1;
}
出于某种原因,该位置在Safari下方再向右一个像素。它看起来正是我希望它与铬

我一直在调查,找不到偏移量的来源。你可以在这里看到我的网站:


下拉菜单位于导航栏上的“外籍教练”下。

在父
li
元素上尝试
位置:相对

header nav ul #expatSub {
  width: 166px;
  position: relative;
}
然后设置嵌套的
ul
元素的
顶部
左侧
,从那里开始:

header nav ul #sublist {
/* ... */
position: absolute;
left: 0;
top: 40px;
z-index: 1;
/* ... */
}

你试过翻译吗?顶部和左侧0和设置转换:translate3d('155px','381px','0px')@keypaul感谢您的回答,尝试了一下,但似乎不起作用(显示在浏览器的左上方),好像没有指定位置