开发者

What Are Other Ways to Do 2-Column Layouts?

I've been stuck with this approach for a 2-column site for quite a while now

  1. wrap elements in a "wrapper" div
  2. float main div to the left
  3. float sidebar to left
  4. apply clearfix on the wrapper div

the problem I am often having is that w开发者_C百科henever a non-floated element in the main div is alongside a floated one, I always have to do clears or clearfixes.

do you have any other approaches for 2-column layouts. by the way, I use the said approach in my blog:


I usually use a grid: http://www.1kbgrid.com/

It's more than just a 2-column layout, but I like the idea of it being flexible. For instance, it's really handy when you have some fancy layouts on the front page and fall back to your default 2-column on all the subpages. Saves a lot of time.


For the #wrapper use overflow:auto instead clear.

Read more at http://www.quirksmode.org/css/clearing.html


I too used your method until i found Yahoos YUI, check it out!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜