在 nivo 滑块中居中图像

发布于 2024-12-24 22:04:23 字数 272 浏览 6 评论 0原文

所以,我在宽度设置为 100% 的 div 中使用 nivo Slider

滑块效果很好,但图像不居中,因为 javascript 总是将背景位置设置为“初始初始”。

我已经强制 div、css 到“center center”,但是 javascript 每次都会改变它。

我在 JS 代码中查找了该标签,但没有找到

有人能给我一点帮助吗?

谢谢

编辑:我想要这个,因为图像有文字,在较低的分辨率下,我需要它们在高分辨率下的同一位置

So, Im using nivo Slider in a div with the width set to 100%

The slider works great but the images do not center because the javascript always sets background-position to "initial initial".

I've forced the div, the css to "center center" but the javascript change it every time.

I looked for the tag in the JS Code but i didnt find it

Can someone give me a little help?

Thank you

EDIT: I want this because the images have words and in the lower resolutions i need them in the same spot that in high resolutions

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

万劫不复 2024-12-31 22:04:23

添加重要属性:

background-position: center center !important;

Add the important property:

background-position: center center !important;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文