• Resolved catwingz

    (@catwingz)


    Hi,
    This is also a WordPress issue, but I am wondering if you can offer a theme-based solution. Some of the pages in this site are going to be text-heavy and I would like to be able to add more space between the paragraphs. I have tried a lot of things in the CSS, the latest being `p {
    margin: 20px 0 !important;
    }`
    but no styling makes a difference, including the code you used in the demo site.

    p
    {
      margin-top: 1.25rem;
      margin-right: 0px;
      margin-bottom: 1.25rem;
      margin-left: 0px;
    }

    The only thing I have found which works is to put an empty <div></div> between each paragraph. I don’t see this as a good solution for my client because it’s not something she will remember.
    Can you offer a solution?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Theme Author Shaped Pixels

    (@shaped-pixels)

    The theme uses this:

    p {
        margin: 1.25rem 0;
    }

    The 1.25rem = 20px, so you won’t see it change. You will want to increase that, but you won’t (or should not) need the !important added.

    For reference of rem (and em) to px, you can use this online source:

    http://www.pxtoem.com

    Thread Starter catwingz

    (@catwingz)

    I’m trying this on different browsers to make sure it’s not a caching issue, but still nothing is budging. The latest in the CSS is

    p {
    	margin-top: 2rem;
    	margin-right: 0;
    	margin-bottom: 3rem !important;
    	margin-left: 0;
    }

    I am using what would be extreme numbers just to determine if I am having any effect. Any thoughts on what might be blocking the changes?

    Theme Author Shaped Pixels

    (@shaped-pixels)

    How are you adding the custom CSS?

    I just tried this in my test site and it worked…

    p {
    margin-bottom: 3rem;
    }
    Thread Starter catwingz

    (@catwingz)

    I am putting it in Appearance > Edit CSS, from the WordPress install, not a plugin. Is there a better way?

    Theme Author Shaped Pixels

    (@shaped-pixels)

    It sounds like you are editing the actual theme’s style.css file (stylesheet) which is actually not a good idea because when there is an update, you will lose your custom changes. If you are using Jetpack, then you can use its Edit CSS feature, otherwise if you’re not using Jetpack, try out a plugin called Simple Custom CSS.

    This will create a new stylesheet and when the site pages load, this one comes after the theme’s own stylesheet.

    Long technical story short, CSS is cascading. So lets say you do this:

    p {
    margin-bottom: 3rem;
    }

    but you paste that before the theme’s own:

    p {
    margin-bottom: 1.25rem;
    }

    The theme’s version will override yours because it comes after it, which is probably why you don’t see any change.

    But try out the Simple Custom CSS plugin and then move your custom CSS changes into that.

    Thread Starter catwingz

    (@catwingz)

    I’m not editing the theme’s stylesheet and am familiar with the cascade. However, with the Edit CSS in the sidebar I’m not at all sure whether it loads before or after. I am familiar with the plugin and have used the plugin before when the Edit feature has been absent. I’ll switch to it and keep my fingers crossed.

    Thread Starter catwingz

    (@catwingz)

    I moved the styles over to the plugin and switched to a different computer, thus a different browser. The paragraphs still aren’t budging, even with !important.
    The current codeβ€”

    p {
    	margin-top: 2rem;
    	margin-right: 0;
    	margin-bottom: 3rem !important;
    	margin-left: 0;
    }

    Any other suggestions?

    Theme Author Shaped Pixels

    (@shaped-pixels)

    I’m not sure what to suggest because I cannot replicate the issue. I was able to do the change without problems. I’m wondering if you have a plugin that is overriding the paragraph selector and styling…

    I’d be able to find out if your site was live because I can then look at the code, so we may have to wait for your site to go live first.

    Thread Starter catwingz

    (@catwingz)

    It is still a work in progress, but I’ve moved the theme over to the public site. You can view it here.

    Theme Author Shaped Pixels

    (@shaped-pixels)

    Got it!
    Your pages show <br> tags instead of <p> tags, for example, I looked at your About page and blog posts. You have one large paragraph with your content and several <br> tags where they should be separate paragraphs. This is why you are not seeing the spacing. At the end of each paragraph that you do have, the custom CSS is working.

    I’m thinking your editor is setup that each time you press the “Enter” key is doing breaks instead of paragraphs, or did you copy your content from an external source?

    Thread Starter catwingz

    (@catwingz)

    I usually wash everything she gives me through a text editor which strips all of the extras out. In this case it sounds like I may have missed that step on some of the key pages. I’m not catching it on my end because the WordPress editor is apparently stripping out all of the tags from vision, but not from function. I didn’t realize it could do that.
    I’m going to redo all of the pages where this matters to see if this can be put to rest. Thanks for playing detective!

    Theme Author Shaped Pixels

    (@shaped-pixels)

    The WP editor is notorious for stripping things out and in my opinion, the default editor is the worse. Anyway, one thing you might want to consider is using an editor that has settings, one that won’t strip out or hide tags like <p> if you were to view it in the text tab. I use two in conjunction with each other…TinyMCE Advanced and then to show the html code, I use HTML Editor Syntax Highlighter.

    Thanks for letting me access to your site as well, because that helped find the problem.

    Thread Starter catwingz

    (@catwingz)

    Problem solved. I think I need a vacation and a new text editor! The HTML Editor Syntax Highlighter looks like it will be great for setup. I’m not sure if I’d leave it activated for my clients though. They are pretty tech phobic!

    thanks again

    Theme Author Shaped Pixels

    (@shaped-pixels)

    No worries… what is important is that the problem is solved πŸ™‚

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

The topic ‘Add space between paragraphs?’ is closed to new replies.