First, it's important to realize that the idea of columns has not really been adopted in CSS. There's plenty of reasons for this, not the least of which being that they're not usually what people want. Nevertheless, we can "mimic" some features of columns using other CSS properties. Frequently, peopel ask, "how can I create two variable width columns?" There's lots of problems from a design point of view, but here's a simple fix.
The idea is simple: (1)floated elements only consume the necessary amount of space, by default. (2)Subsequent inline element will flow next to the floated elements. The following code is used by all the following examples:
/* create the "dyanmic" width left "column" */
.left {
float: left;
background-color: #789;
}
/* create a container to illustrate this */
.container {
margin-top: 1em;
background-color: #d1d1d1;
}
/* the following are two selectors are a simple
"contain float" solution */
.container:after {
display: block; content: "."; height: 0; overflow: hidden; clear: both;
}
* html .container { height: 1em; }
how are you?
how are you?
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In congue, quam id euismod rutrum, mi ligula sagittis nunc, semper viverra lorem orci ut ipsum. Phasellus posuere sagittis lacus. Sed a augue. Vestibulum facilisis. Sed mollis consequat orci. Praesent nec ligula. Proin sagittis. Cras lobortis, wisi ullamcorper suscipit condimentum, sapien massa pretium massa, ac vulputate mi nulla nec enim. Aliquam ullamcorper suscipit wisi. In ac est at quam gravida sollicitudin. Ut rhoncus eros posuere erat. Nulla in dui quis risus scelerisque consequat. Etiam tincidunt tellus et diam. Morbi non ante volutpat ligula suscipit cursus. Cras faucibus. Phasellus tincidunt. Proin lorem. Sed massa. Nam dictum, arcu non accumsan sollicitudin, felis nibh consequat orci, a semper lacus dolor eget leo. Vestibulum at metus.