[resolved] Float:left not pushed all the way with single post (2 posts)

  1. roxmuffin
    Posted 3 years ago #

    I am trying to create a directory that lists and shows contents of all posts in a specified category into 3 columns. I am using the float option to do this, however, when there is only 1 post in a row, it does not float all the way to the left of the container. It only pushes all the way to the left of the container if there are at least 2 posts.
    Here is the CSS:

    #directory {
         width: 100%;
         margin-left: 0px;
    .rmt_listing {
         font-size: 12px;
         line-height: 16px;
         float: left;
         width: 183px;
         margin: 0px 0px 0px 10px;
         padding: 5px;

    and here is the code to display posts on the page:

    foreach ($this->catlist->get_categories_posts() as $single):
    $lcp_display_output .= '<div id="directory">';
    $lcp_display_output .= '<div class="rmt_listing">';
    $lcp_display_output .= '<b>'.$this->get_title_only($single).'</b>';
    $lcp_display_output .= $this->get_thumbnail($single);
    $lcp_display_output .= $this->get_content($single, 'p', '');
    $lcp_display_output .= '<br>';
    $lcp_display_output .= '</div>';
    $lcp_display_output .= '</div>';
    $this->lcp_output = $lcp_display_output;

    *Note: I am using the List Category Posts plugin and have customized the output as shown above.

    How can I get the floating posts to flush all the way to the left at all times (regardless if there are 1 or more posts in a row)?
    Any help would be appreciated! Thanks!

  2. roxmuffin
    Posted 3 years ago #

    After many hours and many attempts with several codes, it came down to adding a height value to the rmt_listing class. Oh boy.....

Topic Closed

This topic has been closed to new replies.

About this Topic