SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Aug 2008
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    bottom border after each wordpress post

    So, I've tried a few things to get a border bottom after each wordpress post on my feedback, but I can't quite get it.

    http://www.connect4webdesign.com/ournewsblog/

    I tried a to target one post specifically and then I tried to target all posts. My goal of course is on class for all posts, but I wanted to test it on one of the posts.

    .post-277 {
    border-bottom:thin solid #333;
    background-color:#66FF33;

    }

    .onepost {
    border-bottom:thin solid #333;
    background-color:#66FF33;

    }



    <?php
    $args = array( 'posts_per_page' => 100, 'order'=> 'ASC', 'orderby' => 'title' );
    $postslist = get_posts( $args );
    foreach ( $postslist as $post ) :
    setup_postdata( $post ); ?>



    <section class="onepost">


    <section <?php post_class()?>>

    <section class="PostsDates">
    <p class="PostsDate"><?php the_time(get_option('date_format'));?></p>
    </section>


    <section class="DateAndExcerpt">

    <p class="PostsTitle"><?php the_title(); ?> </p>

    <section class="PostsExcerpt"><?php the_excerpt(); ?></section>

    </section> <!--DateAndExcerpt-->


    </section> <!--post_class-->

    </section> <!--onepost-->



    <?php
    endforeach;
    wp_reset_postdata();
    ?>

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,176
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Try this:

    Code:
    .onepost {
    border-bottom: thin solid #333;
    background-color: #6F3;
    overflow: hidden;
    }

  3. #3
    SitePoint Addict
    Join Date
    Aug 2008
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It worked! thanks. Ralph.m you or someone else fixed another one of my problems with the same solution. Man this overflow:hidden is nice, but I don't get it 100%

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,176
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by BrianBam View Post
    this overflow:hidden is nice, but I don't get it 100%
    A container doesn't wrap around floated contents by default. They hang out of the container, so the container had zero height. Adding overflow: hidden forces the container to look at what's inside it and to enclose it. It's just one of a number of strategies for bringing this about.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •