Layouts that wrap

That’s a wrap

Test these layouts in narrow, medium and wide views!

Give an element a class="wrap" to wrap its children elements across rows. To do this, the children elements will have to be given a base width by using the flex-basis property (make sure you duplicate this with a -webkit- prefix for poor Safari) – or you can simply use left and right padding or margin. If you do this, the .wrap items will render a fluid flow of content across multiple rows, without following any particular grid structure.

The last row, even if containing fewer elements than other rows, will fill the available width of the parent.

ul.wrap

ul.wrap.reverse

ul.wrap.persistent

ul.wrap.persistent.wide

Hey, pretty easy, huh?

Top of the page, ma!

Layouts that wrap

Defined wrapping layouts

Test these out in medium and wide views!

These are columnar layouts that repeat across rows. They do not require the use of the wrap class (although they can be used together – see the last example on this page), but rather one or more classes defining the column structure. The classes will include a basic division of the parent width, sometimes a multiple of those divisions, and sometimes also a direction. Examples:

<article class="fourths"></article>
<article class="two fourths"></article>
<section class="two thirds right"></article>
<section class="six sevenths left"></article>

Browse through this section for more examples.

article.halves.header

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

article.thirds.header

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

1 Ducky.

… et cetera, all the way up to:

1 Ducky.

2 Ducky.

3 Ducky.

4 Ducky.

5 Ducky.

6 Ducky.

7 Ducky.

8 Ducky.

9 Ducky.

One on the right!

article.phi.left.header

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

1 ducky.

article.two.thirds.left.header

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

1 ducky.

article.three.fourths.left.header

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

1 ducky.

article.four.fifths.left.header

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

1 ducky.

… et cetera, all the way up to:

article.eight.ninths.left.header

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

1 ducky.

And one on the left!

article.phi.right.header

1 ducky.

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

article.two.thirds.right.header

1 ducky.

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

… et cetera, all the way up to:

article.eight.ninths.right.header

1 ducky.

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

Two on the side!

article.two.fourths.header

1 ducky.

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

2 ducky.

article.three.fifths.header

1 ducky.

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

2 ducky.

article.four.sixths.header

1 ducky.

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

2 ducky.

… et cetera, all the way up to:

article.seven.ninths.header

1 ducky.

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

2 ducky.

Without headings!

You may have noticed a lot of these have an additional class of header or footer. These classes ensure that the first and/or last elements within a layout have a width of 100%. These layouts work just fine without headers or footers too:

1 ducky.

article.two.fourths

Ahoy!

2 ducky.

article.six.sevenths.left

Ahoy!

1 ducky.

… et cetera.

Reversed content!

You can reverse the flow of a defined layout element by adding a class of reverse.

1 Ducky.

.two.thirds.right,

  • You’re the one.
  • You make bathtime.
  • Lots of fun.

More great classics and newer hits!

1 Ducky.

.two.thirds.right.reverse,

  • You’re the one.
  • You make bathtime.
  • Lots of fun.

More great classics and newer hits!

Using wrap in combination with a defined wrapping layout

Test these out in narrow and medium views:

To give elements a layout in both narrow and wide view, try using a combination of wrap and one of the defined wrapping layouts.

(Because of a conflict of class names, this may not work with row – or, at least, can cause some unexpected results.)

article.wrap.two.thirds.left.header

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions.

1 ducky.

Top of the page, ma!

Layouts that wrap

One column layouts

section.one …

Check these out in narrow views!

Sometimes you want a single element to align itself left or right, with all elements after (or sometimes before) to align themselves on the opposite side. These are the only layouts that use float instead of flex, and are simple to accomplish in Sessile. Just give the parent element a class of .one, plus whatever division you would like. Examples:

<section class="one third left"></section>
<article class="one fifth right"></article>

Warning: the one class does not play nicely with the header class. Bad ducky!

Rubber ducky

.one.third.left,

  • You’re the one.
  • You make bathtime.
  • Lots of fun.

More great classics and newer hits!

Rubber ducky

.one.third.right,

  • You’re the one.
  • You make bathtime.
  • Lots of fun.

More great classics and newer hits!

Rubber ducky

.one.fourth.right,

  • You’re the one.
  • You make bathtime.
  • Lots of fun.

More great classics and newer hits!

Rubber ducky

.one.ninth.right,

  • You’re the one.
  • You make bathtime.
  • Lots of fun.

More great classics and newer hits!

Check these out in medium and wide views!

.one.ninth.right

Ahoy!
Ahoy!
Ahoy!

.one.fourth.left

Ahoy!
Ahoy!
Ahoy!

Check out this page in wide views!

This HTML document has a class group of one fourth left applied to the main element. Pull the window out to a wide view and take a look!

The wide layout code on this page:

<main class="one fourth left">
    <aside></aside>
    <div></div>
    ... <!-- multiple divs -->
    <footer></footer>
</main>

Warning: The one-column layouts will not work in the narrow view only in Internet Explorer (as of this writing). Also, images may scale strangely in the narrow view in IE. Sessile regretfully decided against drastically enlarging the code for the sake of just this one browser – so until it (the browser, not Sessile) decides to start playing nicely like the others (or until Sessile finds another solution), its users will receive a slightly reduced user experience. Sorry about that!

Top of the page, ma!

Layouts that don’t wrap

Row, row, row

Test these out in narrow views!

Give an element a class="row" to render its child elements horizontally within a single row.

With that single class, child elements will each take up the same width, no matter how many they are. That’s right – as many as you want! (But try not to break the browser, okay?)

Give the parent element padding-left and/or padding-right to add space on either side, or both.

ul.row

Et sessila, et sessila, et sessila…
Startings and endings

flex-basis widths were given to these list items in theme.css.

If you have a limited number of layout items that you want to on the left or right side of a parent element, give it a class of start or end, respectively. You will have to give the items a width in your theme.

Top of the page, ma!

Layouts that don’t wrap

Defined row layouts

Some examples in lists

Test these out in narrow views!

Certain defined layouts are possible used in conjunction with the row class. Because all items are within a single row, things are quite flexible: there’s no need to specify particular widths or divisions. Examples:

<ul class="row two left"></ul>

In this layout, no matter how many lis are contained, the first will have twice the width of the others: so, if there are three lis, the first will be 50% width (the other two being 25% each); if four lis, it will be 40% width (the other three being 20% each); and so on.

The old one-two (or one-three, etc.):

It is also possible to combine two numbers, e.g.:

<ul class="row one-three right"></ul>

In this layout, it is the second li from the right side that will be three times the width of the other items – again, no matter how many there are.

Combinations!

Limitations: The number combinations are limited to a maximum nine-column grid: the highest single number available is eight, while the largest two-number combination is four-five. Note that larger layouts are possible, however, either by simply adding more items, or through the interesting possibility of using both left and right directions at the same time:

<header class="row four-five left right"></header>

When using two-number combinations, the second number must be equal or greater than the first.

ul.row.two-two.left

ul.row.two-three.left

ul.row.two-three.right

ul.row.four-five.right

Left and right, living together!

ul.row.two.left.right

ul.row.two-three.left.right

Top of the page, ma!

Text columns

Sessile Lite provides a simple way to divide text into columns (up to five). The classes are given below, including a way to exclude the first text element, usually a heading, from the columns.

Note: Sessile has removed the top margin from the first text element in each of these, so that the columns align properly at top.

.split.two

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions. One drifts west, where a friendly dolphin jumps over it. A whale sings to another. But, as the sun sets, the 10th little rubber duck is left all alone, bobbing helplessly on the big wide sea. Small readers and listeners will empathize with the little duck's plight – and will rejoice at the heartwarming surprise ending.

In this poignant and funny story, illustrated with strikingly designed collages, Eric Carle also takes readers on an exciting voyage of discovery. Following the little ducks as they float to all parts of the globe, young explorers can see for themselves the meanings of directional words, and learn simple math concepts such as counting and the use of cardinal and ordinal numbers. Each creature the ducks meet is seen in its own habitat and behaves in a true-to-life manner, offering a very simple first view of biology and geography. All aboard for a world of learning and fun!

.split.three

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions. One drifts west, where a friendly dolphin jumps over it. A whale sings to another. But, as the sun sets, the 10th little rubber duck is left all alone, bobbing helplessly on the big wide sea. Small readers and listeners will empathize with the little duck's plight – and will rejoice at the heartwarming surprise ending.

In this poignant and funny story, illustrated with strikingly designed collages, Eric Carle also takes readers on an exciting voyage of discovery. Following the little ducks as they float to all parts of the globe, young explorers can see for themselves the meanings of directional words, and learn simple math concepts such as counting and the use of cardinal and ordinal numbers. Each creature the ducks meet is seen in its own habitat and behaves in a true-to-life manner, offering a very simple first view of biology and geography. All aboard for a world of learning and fun!

.split.four

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions. One drifts west, where a friendly dolphin jumps over it. A whale sings to another. But, as the sun sets, the 10th little rubber duck is left all alone, bobbing helplessly on the big wide sea. Small readers and listeners will empathize with the little duck's plight – and will rejoice at the heartwarming surprise ending.

In this poignant and funny story, illustrated with strikingly designed collages, Eric Carle also takes readers on an exciting voyage of discovery. Following the little ducks as they float to all parts of the globe, young explorers can see for themselves the meanings of directional words, and learn simple math concepts such as counting and the use of cardinal and ordinal numbers. Each creature the ducks meet is seen in its own habitat and behaves in a true-to-life manner, offering a very simple first view of biology and geography. All aboard for a world of learning and fun!

.split.five

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions. One drifts west, where a friendly dolphin jumps over it. A whale sings to another. But, as the sun sets, the 10th little rubber duck is left all alone, bobbing helplessly on the big wide sea. Small readers and listeners will empathize with the little duck's plight – and will rejoice at the heartwarming surprise ending.

In this poignant and funny story, illustrated with strikingly designed collages, Eric Carle also takes readers on an exciting voyage of discovery. Following the little ducks as they float to all parts of the globe, young explorers can see for themselves the meanings of directional words, and learn simple math concepts such as counting and the use of cardinal and ordinal numbers. Each creature the ducks meet is seen in its own habitat and behaves in a true-to-life manner, offering a very simple first view of biology and geography. All aboard for a world of learning and fun!

.split.three.header

About This Book

Ahoy! Here we go around the world with 10 little rubber ducks! “Ducks overboard!” shouts the captain, as a giant wave washes a box of 10 little rubber ducks off his cargo ship and into the sea. The 10 little rubber ducks are swept away in various directions. One drifts west, where a friendly dolphin jumps over it. A whale sings to another. But, as the sun sets, the 10th little rubber duck is left all alone, bobbing helplessly on the big wide sea. Small readers and listeners will empathize with the little duck's plight – and will rejoice at the heartwarming surprise ending.

In this poignant and funny story, illustrated with strikingly designed collages, Eric Carle also takes readers on an exciting voyage of discovery. Following the little ducks as they float to all parts of the globe, young explorers can see for themselves the meanings of directional words, and learn simple math concepts such as counting and the use of cardinal and ordinal numbers. Each creature the ducks meet is seen in its own habitat and behaves in a true-to-life manner, offering a very simple first view of biology and geography. All aboard for a world of learning and fun!