• 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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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.

    Thread Starter Odenberg

    (@murmelin)

    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?

    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 (?)

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

    .pagepost h4 { display:inline; }

    Thread Starter Odenberg

    (@murmelin)

    Thanks for your suggestions and taking time to help me.

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

    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>
    Thread Starter Odenberg

    (@murmelin)

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Get rid of blank space in post’ is closed to new replies.