WordPress.org

Ready to get started?Download WordPress

Forums

Get rid of blank space in post (8 posts)

  1. Odenberg
    Member
    Posted 3 years ago #

    Hi!

    Im building a website with a theme of my own, based on Small Potatoes tutorial.

    I have a problem with the look of my posts. There is a blank space between the headlines and the text in my posts and I cant get rid of it.

    Any kind person how knows how to fix this problem?

    Here is the page it concerns:

    http://bastardforlag.se/wordpress/material/

    I want the black text to come closer to the green text.

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    the space is from the default browser margins of h4 and p;

    to influence this yourself, add these styles to style.css of your theme:

    .pagepost h4 { margin: 15px 0 3px 0; }
    .pagepost p { margin: 3px 0 10px 0;}

    and adjust the number values.

  3. Odenberg
    Member
    Posted 3 years ago #

    Thanks a lot! It worked perfect.

    Another question:
    Do you now how I get the black text at the same line as the green text and not on a new line?

  4. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    imho, with css this is not really possible, as both h4 and p are block style elements which 'insist' on their own line.

    you would maybe need to re-write the post to use spans to style the 'green' text to look like h4 (?)

  5. jtlowe22
    Member
    Posted 3 years ago #

    You could nest the h4 inside the paragraph tag. Then apply display:inline to the h4 tag.

    .pagepost h4 { display:inline; }

  6. Odenberg
    Member
    Posted 3 years ago #

    Thanks for your suggestions and taking time to help me.

    Sorry, Im a WordPress beginner, how do I nest the h4 inside the paragarph?

  7. jtlowe22
    Member
    Posted 3 years ago #

    Not a problem. Try this out. It should work, I think at-least:

    /* Style code */
    .pagepost p h4 { display:inline; } 
    
    /* HTML code */
    <p>
      <h4>ÅTERVUNNA NATURMATERIAL</h4> Istället för att gamla dukar, gardiner
    och tyger slängs, så använder Lilla Gryn de till att göra nya kläder.
     Ibland är hela plagget i återvunnet tyg och ibland blir det återvunna
     tyget detaljer på plagg i nyproducerade, ekologiska material.
    </p>
  8. Odenberg
    Member
    Posted 3 years ago #

    Thank you for your help and answer!

    Unfortunately its not working. I have inserted the code into the post. When I load the page it looks like before (h4 and text on separate lines). Then when I look at the page-code; <p> has been inserted in the post just before the black text.

    How do I get rid of it? I guess I´ve missed something basic in my css-file.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.