Fancybox error: prev and next areas have black background on hover

回眸只為那壹抹淺笑 提交于 2019-12-13 14:07:03

问题


I've installed an unmolested version of Fancybox 2 on a site I'm building - it all works fine apart from when hovering over the previous, next and close areas a black background appears over the image.

The only modifications I have made to the standard Fancybox are controls for the fadein speeds etc

You can see the page here

If you click on any of the images, the you will see the issue when hovering over the next / prev / close buttons.

I've used this on another site and haven't had this problem, so can't see what the issue is.

Any help much appreciated.


回答1:


Well, it's not a fancybox error but a user-generated behavior.

That black area is actually a link within fancybox to move to the next/prev elements of the gallery and becomes black because you have this CSS rule (line 25) in your style.css file :

a:link {
    color: #000000;
    text-decoration: none;
}

Generally speaking it's not a good idea to apply general CSS rules to tag elements because they will affect the whole site (as it does in this case), use specificity instead like :

#parent_container a:link {
    color: #000000;
    text-decoration: none;
}

or

a.this_class:link {
    color: #000000;
    text-decoration: none;
}


来源:https://stackoverflow.com/questions/12626689/fancybox-error-prev-and-next-areas-have-black-background-on-hover

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!