针对五个模块的不同类型布局demo,基本上概括了所有需求,很有代表性。注意dtd为strict模式,编码是已改为utf。 个人觉得虽然实用有限,但作为技术参考,一定程度上总结了很多解决方案。 固定代码架构,分为五个部分 eader, content, navigation, other stuff and footer HTML: <div id="container"> <div id="header">Header</div> <div id="wrapper"> <div id="content">Content</div> </div> <div id="navigation">Navigation</div> <div id="extra">Extra stuff</div> <div id="footer">Footer</div> </div> 作者是意大利设计师,标题不好翻译,看示意图加例子就明白了。 Three percentage columns (n.01) http://www.rexsong.com/blog/attachments/200603/04_layoutgala01.htm Three percentage columns (n.02) http://www.rexsong.com/blog/attachments/200603/04_layoutgala02.htm Three percentage columns (n.03) http://www.rexsong.com/blog/attachments/200603/04_layoutgala03.htm Three percentage columns (n.04) http://www.rexsong.com/blog/attachments/200603/04_layoutgala04.htm Three percentage columns (n.05) http://www.rexsong.com/blog/attachments/200603/04_layoutgala05.htm Three percentage columns (n.06) http://www.rexsong.com/blog/attachments/200603/04_layoutgala06.htm Three fixed columns (n.7) http://www.rexsong.com/blog/attachments/200603/04_layoutgala07.htm Three fixed columns (n.8) http://www.rexsong.com/blog/attachments/200603/04_layoutgala08.htm Three fixed columns (n.9) http://www.rexsong.com/blog/attachments/200603/04_layoutgala09.htm Three fixed columns (n.10) http://www.rexsong.com/blog/attachments/200603/04_layoutgala10.htm Three fixed columns (n.11) http://www.rexsong.com/blog/attachments/200603/04_layoutgala11.htm Three fixed columns (n.12) http://www.rexsong.com/blog/attachments/200603/04_layoutgala12.htm Liquid, secondary columns fixed-width (n.13) http://www.rexsong.com/blog/attachments/200603/04_layoutgala13.htm Liquid, secondary columns fixed-width (n.14) http://www.rexsong.com/blog/attachments/200603/04_layoutgala14.htm Liquid, secondary columns fixed-width (n.15) http://www.rexsong.com/blog/attachments/200603/04_layoutgala15.htm Liquid, secondary columns fixed-width (n.16) http://www.rexsong.com/blog/attachments/200603/04_layoutgala16.htm Liquid, secondary columns fixed-width (n.17) http://www.rexsong.com/blog/attachments/200603/04_layoutgala17.htm Liquid, secondary columns fixed-width (n.18) http://www.rexsong.com/blog/attachments/200603/04_layoutgala18.htm Liquid, three columns, hybrid widths (n.19) http://www.rexsong.com/blog/attachments/200603/04_layoutgala19.htm Liquid, three columns, hybrid widths (n.20) http://www.rexsong.com/blog/attachments/200603/04_layoutgala20.htm Liquid, three columns, hybrid widths (n.21) http://www.rexsong.com/blog/attachments/200603/04_layoutgala21.htm Liquid, three columns, hybrid widths (n.22) http://www.rexsong.com/blog/attachments/200603/04_layoutgala22.htm Two columns liquid, side fixed (n.23) http://www.rexsong.com/blog/attachments/200603/04_layoutgala23.htm Two columns liquid, side fixed (n.24) http://www.rexsong.com/blog/attachments/200603/04_layoutgala24.htm Two percentage columns (n.25) http://www.rexsong.com/blog/attachments/200603/04_layoutgala25.htm Two percentage columns (n.26) http://www.rexsong.com/blog/attachments/200603/04_layoutgala26.htm One column liquid and two halves (n.27) http://www.rexsong.com/blog/attachments/200603/04_layoutgala27.htm One column liquid and two halves (n.28) http://www.rexsong.com/blog/attachments/200603/04_layoutgala28.htm Two percentage columns and one larger (n.29) http://www.rexsong.com/blog/attachments/200603/04_layoutgala29.htm Two percentage columns and one larger (n.30) http://www.rexsong.com/blog/attachments/200603/04_layoutgala30.htm Two columns liquid, fixed side and large one (n.31) http://www.rexsong.com/blog/attachments/200603/04_layoutgala31.htm Two columns liquid, fixed side and large one (n.32) http://www.rexsong.com/blog/attachments/200603/04_layoutgala32.htm Two colums fixed (n.33) http://www.rexsong.com/blog/attachments/200603/04_layoutgala33.htm Two colums fixed (n.34) http://www.rexsong.com/blog/attachments/200603/04_layoutgala34.htm Two colums fixed (n.35) http://www.rexsong.com/blog/attachments/200603/04_layoutgala35.htm Two colums fixed (n.36) http://www.rexsong.com/blog/attachments/200603/04_layoutgala36.htm Two colums fixed (n.37) http://www.rexsong.com/blog/attachments/200603/04_layoutgala37.htm Two colums fixed (n.38) http://www.rexsong.com/blog/attachments/200603/04_layoutgala38.htm One column fixed and two halves (n.39) http://www.rexsong.com/blog/attachments/200603/04_layoutgala39.htm One column fixed and two halves (n.40) http://www.rexsong.com/blog/attachments/200603/04_layoutgala40.htm 兼容 Internet Explorer/win 5.0, 5.5, 6 and beta 2 preview of version 7; Opera 8.5, Firefox 1.5 and Safari 2 Referrence: a collection of 40 CSS layouts based on the same markup and ready for download! http://blog.html.it/layoutgala/ ========================================== 来源:http://www.rexsong.com/blog/article.asp?id=287 (一叶千鸟)
整个放在一个div好么? 我都是象处理table一样处理div,最多每行一个。 有时候甚至行都不用div包起来 http://zf.foxso.net/div/divtest.htm 前几天做的,也是我第一次用div+css布局。 中间草草的做了一下,没有修饰。 将就过了XHTML 1.0 Strict 和css得校验。 不过理念上应该还是不对吧。 还要好好象意大利大师学习。