WordPress.org

Ready to get started?Download WordPress

Forums

Problem padding at top of new custom divs (6 posts)

  1. 3stripe
    Member
    Posted 9 years ago #

    Day two of learning WordPress at http://www.creativeyoungteam.com/

    I've added 2 divs to a static homepage showing recent events. But there is some sort of extra padding at the top of them, before the text starts, that I can't work out how to get rid of... any suggestions.... !!??

    Thanks, James.

    #boxone {
    float: left;
    padding: 10px;
    margin: 0px;
    background: #ccc;
    width: 200px;
    height: 200px;
    }
    #boxtwo {
    float: right;
    padding: 10px;
    margin: 0px;
    background: #ccc;
    width: 200px;
    height: 200px;
    }

    EDIT....

    Oh yeah here's the code from home.php as well in case that helps:

    <div id="boxone">
    <h2>CYT Events</h2>
    <br>
    <?php c2c_get_recent_posts(3, "%post_URL%<br />%post_excerpt_short%<br><br>", "1"); ?>
    </div>

    <div id="boxtwo">
    <h2>Other Events</h2>
    <br>
    <?php c2c_get_recent_posts(3, "%post_URL%<br />%post_excerpt_short%<br><br>", "3"); ?>
    </div>

  2. Ming
    Member
    Posted 9 years ago #

    It looks like it's your navigation (<div class="navigation">). With that removed the spacing is better. Even though the div's are empty, and they don't show, they still take up space.

  3. 3stripe
    Member
    Posted 9 years ago #

    I was talking about the space above them, inside the grey squares. Worked out how to remove that by defining a custom <h2> tag without the 30px margin at the top :-)

    So now there is just that extra white space, below the intro text and before the grey boxes start.... taking out <div class="navigation"> has definetely helped, but seems to be one more element in the way.... hmmm

  4. Root
    Member
    Posted 9 years ago #

    How about: Put a border round the grey boxes in grey so you dont see it ?

  5. 3stripe
    Member
    Posted 9 years ago #

    Hey thanks the pointers people. Finally got it sorted now:

    http://www.creativeyoungteam.com/

    Next step, some nice rounded corners for the grey boxes... I'm liking the look of http://www.alistapart.com/articles/mountaintop/ ... typical minimalism from Dan Cederholm....

  6. Ming
    Member
    Posted 9 years ago #

    Some rounded boxes would definitely polish it off.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags