Title: Responsive caption
Last modified: April 26, 2019

---

# Responsive caption

 *  Resolved [Drauth](https://wordpress.org/support/users/drauth/)
 * (@drauth)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/responsive-caption/)
 * Hi,
 * is there a way (CSS?) to have the gallery captions reponsive?
    I noticed that
   on smartphone the caption overflow the screen, see [http://prntscr.com/nh2qb0](http://prntscr.com/nh2qb0)
 * Thanks
 * Simone
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fresponsive-caption%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 13 replies - 1 through 13 (of 13 total)

 *  [Mihai Ceban](https://wordpress.org/support/users/mihaiimagely/)
 * (@mihaiimagely)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/responsive-caption/#post-11469779)
 * Hi [@drauth](https://wordpress.org/support/users/drauth/),
 * There seems to be a styling problem with the Fancybox in your case. I hope that
   you wouldn’t mind checking for a plugin conflict by temporarily deactivating 
   all the plugins excepting NextGen Gallery and cleaning the cache to see if this
   will change anything.
 *  Thread Starter [Drauth](https://wordpress.org/support/users/drauth/)
 * (@drauth)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/responsive-caption/#post-11469841)
 * Thanks a lot for the quick answer.
    I found quickly the cuplrit. Is Autoptimize
   plugin with “optimize JS” option set. It changes all the visualization of the
   caption, with Autoptimize on, the captions are white on a semitransparent black
   background, when off the captions are black on white background (see [http://prntscr.com/nh5mjt](http://prntscr.com/nh5mjt))
   and I prefer this version… It also changes the behaviour for the long lines, 
   with no need to insert manually <br/>. Any clue to have JS optimized and captions
   working as expected? Thanks
 * Simone
 *  [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/responsive-caption/#post-11469925)
 * First and foremost (if not done so already) try confirm it is JS optimization
   that is breaking things by just disabling that (and else try to disable CSS optimization).
 * Once you know that, dive in and try identify what code/ files (CSS or JS) are
   responsible for the broken feature and try excluding that. If the problem is 
   with JS, chances are you’ll find useful information on your browser’s developer
   console. Alternatively you can also try just unticking the “aggregate JS”-option.
 * There’s more info in the troubleshooting tips and info on exclusions in [the AO FAQ](https://wordpress.org/plugins/autoptimize/#faq).
 * hope this helps,
    frank (ao dev)
 *  [Mihai Ceban](https://wordpress.org/support/users/mihaiimagely/)
 * (@mihaiimagely)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/responsive-caption/#post-11470199)
 * Hi [@drauth](https://wordpress.org/support/users/drauth/),
 * Great to hear that you’ve found the culprit. You may want to exclude the following
   CSS file from the Autoptimize and check if everything else works fine:
 * /wp/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/
   static/fancybox/jquery.fancybox-1.3.4.css
 *  Thread Starter [Drauth](https://wordpress.org/support/users/drauth/)
 * (@drauth)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/responsive-caption/#post-11470347)
 * Thans,
    I did it [see [http://prntscr.com/nh7tu3%5D](http://prntscr.com/nh7tu3%5D)
   but still, when Optimize Js is on, captions don’t work as exepceted… Isn’t a 
   matter to exclude some JS instead/along with the mentioned CSS? Simone
 *  [Mihai Ceban](https://wordpress.org/support/users/mihaiimagely/)
 * (@mihaiimagely)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/responsive-caption/#post-11481908)
 * Hi [@drauth](https://wordpress.org/support/users/drauth/),
 * Can you please try to exclude this JS resource as well?
 * `nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/
   jquery.fancybox-1.3.4.pack.js`
 *  Thread Starter [Drauth](https://wordpress.org/support/users/drauth/)
 * (@drauth)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/responsive-caption/#post-11509006)
 * Hi,
 * nope…
 * Please see the difference without JS optimization [http://prntscr.com/nlzyqq](http://prntscr.com/nlzyqq)
 * as **I would like to be**, and with JS optimization [http://prntscr.com/nlzz6t](http://prntscr.com/nlzz6t)
 * Did I set the options right? See [http://prntscr.com/nlzzn7](http://prntscr.com/nlzzn7)
 * Thanks
 * Simone
 *  Thread Starter [Drauth](https://wordpress.org/support/users/drauth/)
 * (@drauth)
 * [7 years ago](https://wordpress.org/support/topic/responsive-caption/#post-11583088)
 * Any answer?
 *  [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years ago](https://wordpress.org/support/topic/responsive-caption/#post-11583166)
 * hey Simone;
    I had a quick look and although JS optimization is off now, the 
   captions are still not shown as in your “would like to be”. Even more, when AO
   is entirely disabled (by adding `?ao_noptimize=1` to the URL) I still see the
   captions with white background;
 * ![](https://i0.wp.com/pix.toile-libre.org/upload/original/1559120894.jpg)
 * So not sure what is wrong here, but _might_ not be due to AO after all?
 * frank
 *  Thread Starter [Drauth](https://wordpress.org/support/users/drauth/)
 * (@drauth)
 * [7 years ago](https://wordpress.org/support/topic/responsive-caption/#post-11584986)
 * Thanks, but I can’t confirm what you say.
 * With JS optimization **activated **on AO captions are white on black blackgroun
   and not responsive
 * With JS optimization **deactivated **on AO **OR** [http://www.panarea.com/il-mare-e-gli-uomini/?ao_noptimize=1](http://www.panarea.com/il-mare-e-gli-uomini/?ao_noptimize=1)
   captions are black on white background and responsive as expected and wanted.
   
   Note, that I keep JS optimization deactivated in order to have the right captions
   but I would like to activate it…
 * Thanks again
    Simone
 *  [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years ago](https://wordpress.org/support/topic/responsive-caption/#post-11585112)
 * ah, I misunderstood, you want them black on white, not white on black 🙂
 * have you tried adding `wp-content/plugins/nextgen-gallery/` to the comma-separated
   JS optimization exclusion list?
 *  Thread Starter [Drauth](https://wordpress.org/support/users/drauth/)
 * (@drauth)
 * [7 years ago](https://wordpress.org/support/topic/responsive-caption/#post-11607096)
 * SOLVED:
    See [http://prntscr.com/nxu9e8](http://prntscr.com/nxu9e8)
 *  [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years ago](https://wordpress.org/support/topic/responsive-caption/#post-11607177)
 * good job Drauth 🙂

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Responsive caption’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * [captions](https://wordpress.org/support/topic-tag/captions/)

 * 13 replies
 * 3 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/responsive-caption/#post-11607177)
 * Status: resolved