adsense

How to Change WordPress Gallery Spacing





1. Visit the 'wp-admin' directory of your website and log in to the WordPress dashboard. Navigate to 'Appearance' and click the 'Editor' link to load the 'Edit Themes' screen. Find the 'style.css' link at the bottom of the list under 'Templates' and click to load it in the editor box.
2. Add the following code to the bottom of style.css:.gallery-item {margin-top: XXpx !important;margin-left: XXpx !important;margin-bottom: XXpx !important;margin-right: XXpx !important;}The class name 'gallery-item' matches the code WordPress generates for the gallery. WordPress automatically adds CSS code to any page containing an image gallery. In CSS, code between style tags on a Web page takes priority over code in an external CSS file, so you must use '!important' to override those on-page styles.

3. Click the blue 'Update File' button to save your changes. Visit your website and take a look at your gallery. If the new spacing creates a conflict with the rest of the site's design, go back and make tweaks to style.css until the gallery looks good.

Comments

0 Responses to "How to Change WordPress Gallery Spacing"

Post a Comment

Popular Posts

About