我正在尝试在我的网站上使用 fancybox2,当我使用 fancybox 链接 (Firefox) 时,我的页面一直向右移动。从我读到的内容来看,我可以通过更改 fancybox css 来修复它,但我不会成功。
我有:
body{
width: 1024px;
margin: auto; !important;
}
当使用 fancybox 时,它得到(从 Firebug 看到):
<body style="margin-right: 0px;">
我尝试更改 css 行:
.fancybox-lock {
overflow: auto;
}
和
.fancybox-lock .fancybox-overlay {
overflow: auto;
overflow-y: scroll;
}
但这并不能解决问题。
如有任何帮助,我们将不胜感激!
最佳答案
当使用 !important 时,它应该与值并排而不是在分号之后。
这是错误的:
margin: auto; !important;
这是正确的:
margin: auto !important;
希望这能让您更接近解决方案。
关于jquery - Fancybox2 通过添加 margin-right 修改 <body> 的 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15117676/