In the same way that you specify any div, you can give it either a class
or an id
.
As regards your intent to use the div to enforce 'column-like' behaviour, you're limited to either a limited implementation of CSS columns:
#div_id {
column-width: 10em; /* not well-implemented yet. */
-moz-column-width: 10em;
-webkit-column-width: 10em;
column-gap: 1em;
-moz-column-gap: 1em;
-webkit-column-gap: 1em;
column-count: 3;
-moz-column-count: 3;
-webkit-column-count: 3;
column-rule: 1px solid #000;
-moz-column-rule: 1px solid #000;
-webkit-column-rule: 1px solid #000;
}
If you specify -vendor-column-count: 3
and omit the -vendor-column-width
the browser will implement 3 columns with the width automatically calculated by the rendering engine, conversely if you specify the -vendor-column-width: 10em
without specifying the -vendor-column-count
the browser will calculate the appropriate number of columns to display.
Clearly these CSS3 properties are implemented by only Chrome/Safari (-webkit
) and Firefox (-moz
).
For cross-browser support you would need to use a JavaScript solution (or use a server-side technology): A List Apart has an article that references a JS implementation.