Support » Themes and Templates » Problem padding at top of new custom divs

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

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

    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

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

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

    Some rounded boxes would definitely polish it off.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Problem padding at top of new custom divs’ is closed to new replies.