Treehouse: Grow your CSS skills. Land your dream job.

Post doesn’t line up properly

  • # December 10, 2012 at 10:17 pm

    On my website [which you can see here]( “elusivebuck”)

    My first post seems to be bigger height wise then the others which makes stacking messed up for the third post. Can someone help me fix this? If I zoom in, it seems to line up properly but when I go back to my normal resolution it gets messed up again.

    # December 10, 2012 at 10:26 pm

    That’s because there is more content in the first box, making it larger. You’ll need to set up the ‘read more’ to truncate a specific range that guarantees a set height.

    # December 10, 2012 at 10:35 pm

    Not sure why it’s doing it though. I’m using these functions to create the excerpt

    // Changing excerpt length
    function new_excerpt_length($length) {
    return 42;
    add_filter(‘excerpt_length’, ‘new_excerpt_length’);

    // Changing excerpt more
    function new_excerpt_more($more) {
    global $post;
    return ‘…ID) . ‘”>’ . ‘Read More »’ . ‘‘;
    add_filter(‘excerpt_more’, ‘new_excerpt_more’);

    # December 10, 2012 at 10:44 pm

    You’ll probably need to set a height in the CSS as well, as different characters have different widths and could end up making the post too tall anyways.

    # December 10, 2012 at 10:49 pm

    alrighty I’ll give that a try. Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.