简体   繁体   English

如何更改 Fancybox 3 中的控制栏颜色?

[英]How to change the control bar color in Fancybox 3?

I want to change the color of the controls of my Fancybox 3 gallery, as the default is barely readable.我想更改我的 Fancybox 3 画廊控件的颜色,因为默认值几乎不可读。

I already loaded a separate Fancybox stylesheet, that allows me to change the color of the background.我已经加载了一个单独的 Fancybox 样式表,它允许我更改背景的颜色。 I can not find a way to change the color of the controls using the same method, though.不过,我找不到使用相同方法更改控件颜色的方法。

Contents of fancybox.css: fancybox.css的内容:

.fancybox-bg {
    background: #ccc;
}

.fancybox-is-open .fancybox-bg {
    opacity: 0.4;
}

Use利用

.fancybox-bg {
    background: #ccc !important;
}

Please use the parent element or class or id to override plugin css.请使用父元素或 class 或 id 覆盖插件 css。 For example例如

div.fancybox-bg{...} or.class_name.fancybox-bg{...} div.fancybox-bg{...} 或.class_name.fancybox-bg{...}

You should be more specific about what color you would like to change, but if you refer to buttons in the top right corner, then you can do that by tweaking .fancybox-button class, example:您应该更具体地说明要更改的颜色,但是如果您参考右上角的按钮,则可以通过调整.fancybox-button class 来做到这一点,例如:

.fancybox-button {
  background: red;
  color: #fff; /* Tip: This will change icon color */
  padding: 0; /* Tip: Change padding to resize icon */
}

Important: Make sure you add your CSS customization code AFTER including fancybox.css重要提示:确保在包含 fancybox.css 之后添加您的 CSS 自定义代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM