The
Palm
Civet

Posts tagged css

css cell snippet

this is my current favorite css snippet, taken from teddy zetterlund’s simple css grid =>


.cell { display: -moz-inline-stack; display: inline-block; 
vertical-align: top; *display: inline; *zoom: 1; }

{ display: inline-block } is really useful, but not supported across all of today’s browsers. the inline-block property gives you the ability to stack a bunch of elements in an inline fashion with the space-awareness of blocked elements, much like using  { float: left } on a bunch of blocked elements, without worrying about the messiness of clearing your floats. it’s the perfect base for a grid layout or a gallery of thumbnails or a navigation menu.

this snippet allows you to treat any element like an inline-block, using -moz-inline-stack for firefox 2 and the *display: inline hack for ie 7 and below.

compiling and sharing code, ideas, and tools for making better websites and applications.

by justin talbott {email me}

what is a palm civet?