Jump to content

Archived

This topic is now archived and is closed to further replies.

primetime

Unwanted spacing between H2 and paragraph

Recommended Posts

primetime+    2
primetime

Hi,

 

How do I reduce the space between my H2 headings and my paragraphs using custom LESS/CSS?  I tried finding the answers in the Wordpress forums but to no avail. 

 

Thanks,

Vincent

Share this post


Link to post
Share on other sites
batman    389
batman

Hi primetime

Please post your site's url so we can properly troubleshoot the issue for you.

;)


Life is too short to remove USB safely ...

Share this post


Link to post
Share on other sites
jmad+    80
jmad

primetime  I think the spacing actually looks good but you could increase the top spacing if you wanted.  However, to answer your question there are a couple of ways to handle this.  

 

You could change the bottom margin for all h2 level headers using CSS like (see below) and add it to the custom CSS area.  This will change the bottom margin of all h2 elements throughout your site.

 

h2 {

margin-bottom: 10px;

}

 

Or you could add a custom class to the specific section or component and then only that area will be impacted by the CSS.  You would use the CSS below and add "custom-class" to your CSS area of the section or component.

 

.custom-class h2 {

margin-bottom: 10px;

}

 

Again add "custom-class" to your section or component.

Share this post


Link to post
Share on other sites
primetime+    2
primetime

Hi,

 

I tried both methods and it's not working.

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

primetime - Your issue is that you're attempting to customize your site and have a cache plugin active. If you're still in the process of styling your site, you will need to disable your cache plugin before you go ahead and start adding custom CSS etc...

 

Once you have your sites design finalised, then enable the cache plugin again. Also, please be aware that cache plugins do not work by simply enabling the plugin, they need to be configured to match your server configuration. You will want to contact your web host provider and ask them for assistance. If a cache plugin isn't configured correctly, then it can cause issues on your site.

 

Also, we include some classes in DMS which you can use to remove margins from elements. All you need to do is add them to the tag. For example at the moment you have this:

 

<h2>1) Totoya Michi</h2>

 

If you replace that with the following:

 

<h2 class="zmt zmb">1) Totoya Michi</h2>

 

It will give you the following:

 

https://cloudup.com/cPGmUNG9SFC

 

You can find more about these classes here - http://docs.pagelines.com/tutorials/html-css-utilities


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
primetime+    2
primetime

Danny I've deactivated my cache and updated my html to <h2 class="zmt zmb">1) Totoya Michi</h2>, this worked for me.

 

When I tried to add h2 {margin-bottom: 5px;} in custom less/css this doesn't work.  I would like to change the H2 margin-bottom site wide.

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Can you provide a screenshot of where you added that custom CSS please.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
primetime+    2
primetime

Attached Danny

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Try this instead:

 

.post h2 {
  margin-bottom: 5px;
}

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

No problem.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • Michael Kummer
      By Michael Kummer+
      Hi guys,
      we have noticed that the Elements section is displaying incorrectly under IE11 on Windows 10. See xiting.us. The 3 sections above the footer are Elements sections and they have way too much spacing.
      Is this a known issue?
      Thanks
      Michael
    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
×