Title: Remove padding on mobile
Last modified: February 18, 2026

---

# Remove padding on mobile

 *  Resolved [Roland Bischoff](https://wordpress.org/support/users/rolandbischoff/)
 * (@rolandbischoff)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/remove-padding-on-mobile/)
 * Hi there,
 * is there any way to remove padding on mobile screens?
 * I disabled buttons on mobile,
 *     ```wp-block-code
       /* Smartphones */@media (max-width: 768px) {    .pswp__button, .pswp__counter {		display: none !important;    }}
       ```
   
 * so there is no need for the white space beside the image. The image should fill
   the available space of a mobile display.
 * I read [https://photoswipe.com/styling/](https://photoswipe.com/styling/), but
   I don’t know how to implement JS on my site (I suppose the examples of Dmytro
   are JS, aren’t they?).
 * I think the padding I made in the plugin (Lightbox with PhotoSwipe > Theme > 
   Image padding > 80px) are stored in this code:
 *     ```wp-block-code
       var lbwpsOptions = {"label_facebook":"Share on Facebook","label_twitter":"Tweet","label_pinterest":"Pin it","label_download":"Download image","label_copyurl":"Copy image URL","label_ui_close":"Close [Esc]","label_ui_zoom":"Zoom","label_ui_prev":"Previous [\u2190]","label_ui_next":"Next [\u2192]","label_ui_error":"The image cannot be loaded","label_ui_fullscreen":"Toggle fullscreen [F]","label_ui_download":"Download image","share_facebook":"0","share_twitter":"0","share_pinterest":"0","share_download":"0","share_direct":"0","share_copyurl":"0","close_on_drag":"1","history":"1","show_counter":"1","show_fullscreen":"0","show_download":"0","show_zoom":"0","show_caption":"0","loop":"0","pinchtoclose":"1","taptotoggle":"1","close_on_click":"1","fulldesktop":"0","use_alt":"0","usecaption":"0","desktop_slider":"1","share_custom_label":"","share_custom_link":"","wheelmode":"zoom","spacing":"12","idletime":"3000","hide_scrollbars":"1","caption_type":"below","bg_opacity":"100","padding_left":"80","padding_top":"80","padding_right":"80","padding_bottom":"80"};
       ```
   
 * How can I access this? Can I change the padding for mobile with CSS?
 * Regards,
   Roland
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fremove-padding-on-mobile%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/remove-padding-on-mobile/#post-18826022)
 * By default there is no “white space” around the image. Also see my reference 
   site: [Lightbox with PhotoSwipe 5 (overlay caption) – WordPress Demo](https://wordpress-demo.arnowelzel.de/lightbox-with-photoswipe-5-overlay-caption/)
   on a mobile device.
 * About the padding, which you can add if needed – this is passed as frontend variables
   by WordPress and you can not override this on your own as this is passed as parameter
   to PhotoSwipe and is not as CSS rule. Also see [https://photoswipe.com/options/](https://photoswipe.com/options/)–
   this explains all the options PhotoSwipe supports.
 * However if you want **add** a visual padding around the images just for desktop
   devices, a rule like this may work (I assumed the switch point for “mobile” is
   less then 480px but you have to decide what fits best for you):
 *     ```wp-block-code
       @media (min-width: 480px) {    .pswp__img {        padding: 20px;    }}
       ```
   
 * Since the decision, what is “desktop device” is not that simple, there is no 
   specific setting for this in the backend and PhotoSwipe itself also does not 
   have any option to choose a specific padding for mobile devices only.
 *  Thread Starter [Roland Bischoff](https://wordpress.org/support/users/rolandbischoff/)
 * (@rolandbischoff)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/remove-padding-on-mobile/#post-18826068)
 * Thank you, works fine as far as I see.
 * But I’ld like to present my photos with rounded corners – that doesn’t work
 *     ```wp-block-code
       /* Desktop */@media (min-width: 769px) {    .pswp__img {        padding: 80px;        border-radius: 4px !important;    }}
       ```
   
 * Any idea why `border-radius`doesn’t work?
 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/remove-padding-on-mobile/#post-18826096)
 * The border and its corners are still the outer edge and not around the image 
   itself, since “padding” means “add space between the content and the border”.
 * Adding a border radius which is bigger than the padding should work – you have
   to play around with the values to see what works best for you:
 *     ```wp-block-code
       /* Desktop */@media (min-width: 769px) {    .pswp__img {        padding: 80px;        border-radius: 88px;    }}
       ```
   
 * And always keep in mind: customizations like this may not work with future updates
   of Photoswipe!
 *  Thread Starter [Roland Bischoff](https://wordpress.org/support/users/rolandbischoff/)
 * (@rolandbischoff)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/remove-padding-on-mobile/#post-18826325)
 * Thanks a lot, that solved my problem. Otherwise I would have to go back to Photoswipe
   4 …
 * One last question: Could you give me a hint, a starting point where I could learn
   how to use the options, Dmytro shows on [https://photoswipe.com/options/](https://photoswipe.com/options/)?

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fremove-padding-on-mobile%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/lightbox-photoswipe/assets/icon-256x256.png?rev=2906302)
 * [Lightbox with PhotoSwipe](https://wordpress.org/plugins/lightbox-photoswipe/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lightbox-photoswipe/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lightbox-photoswipe/)
 * [Active Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lightbox-photoswipe/reviews/)

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [Roland Bischoff](https://wordpress.org/support/users/rolandbischoff/)
 * Last activity: [3 months, 2 weeks ago](https://wordpress.org/support/topic/remove-padding-on-mobile/#post-18826325)
 * Status: resolved