Support » Themes and Templates » CSS floating left/right trouble

  • I’ve recently posted:

    which is based on the default theme with a lot of modified code. One change was to make the more recent entry two columns wide with the others single columns, all based on CSS blocks. The trouble is if a lefthand story is longer (taller) than a righthand story, the next lefthand story doest float all the way to the left, resulting in some odd staggering. So I’m looking for CSS code that can force the write position down and to the left.

    Currently you’ll see this on the site if you scroll down and look at the position of the “Welcome!” post. It should be on the left, but the “Octoberfest behind the scenes” story is too long to allow it.

    Here are the changes I made to implement the column split:

    in index.php, I added:

    if ($msc_postposition==””) {echo ‘class=”post” ‘; $msc_postposition=”left”;}
    elseif ($msc_postposition==”left”) {echo ‘class=”postleft” ‘; $msc_postposition=”right”;}
    elseif ($msc_postposition==”right”) {echo ‘class=”postright” ‘; $msc_postposition=”left”;}

    So this tracks the position (starting with TOP, then alternating left and right). I’ve added CSS styles called POSTLEFT and POSTRIGHT which have “float: left;” and “float: right;”, along with narrower widths.

    Any suggestions on forcing the left/right setup? I could easily do this with tables (using a new table row with each pair) but I want to stick with CSS layout.


  • The topic ‘CSS floating left/right trouble’ is closed to new replies.