ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Columns & Rows: Getting switch to close divs intelligently (Part Two)

November 08, 2012 11:52am

Subscribe [4]
  • #16 / Nov 23, 2012 2:45pm

    Evolve Websites

    110 posts

    If it’s just for containing content then you could do away with it and style your 3 blocks accordingly, eg:

    Basic code for your loop:

    <div class="box {switch='a|b|c}"><h1>{title}</h1></div>

    Then CSS

    .box { width: 33.3%; } /* set box width */
    .a { float: left; clear: left; } /* first in row */
    .b { float: left; } /* second in row */
    .c { float: right; } /* last in row */

    The trick here is clear: left, this should start the 4th box on a new “row” and so on.

    Hi Rob,

    That is currently how they’re styled, but if the columns are different lengths then they are not always appearing in a row in IE7.

    Does that make sense?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases