Css背景图像位置动画

时间:2016-02-14 02:32:23

标签: css background background-image background-size

我正在尝试制作一个附有a:hover背景图像的菜单。我有不同大小的菜单链接,所以我想我可以将图像的一部分对齐,左边另一个对齐,一个中心图像可以拉伸,当我应用它时,它的工作方式除了当你第一次将鼠标悬停在它上面时,整个图像向下滑动几个像素到位。当我使用一个背景图像时,我遇到了同样的问题,当使用background-size包含时,我遇到了同样的问题。这种情况发生在Chrome,Firefox和Ie中。 Windows 7。



li#menubg1 a:hover, ul li li#menubg1 a:hover {
    background: url("D:\hoverleft.png") no-repeat left, url("D:\hoverright.png") no-repeat right, url("D:\hovermiddle.png") no-repeat center;
    background-size: auto, auto, 100% 34px;
}




1 个答案:

答案 0 :(得分:0)

// does this manual optimisation help improve performance, or does it make?
int size = myvector.size();
for (int i = 0; i < size; ++i)
    cout << myvector[i] << " ";

我想我找到了问题的答案