简体   繁体   中英

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.

I already loaded a separate Fancybox stylesheet, that allows me to change the color of the background. I can not find a way to change the color of the controls using the same method, though.

Contents of 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. For example

div.fancybox-bg{...} or.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 {
  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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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