Mais conteúdo relacionado Semelhante a The Home of the Future: CSS Layouts (20) The Home of the Future: CSS Layouts1. THE HOME OF THE FUTURE
PETER GASSTON
STOPSATGREEN
broken-links.com
12. Flex-box
.holder { display: box; }
.child { box-flex: 1; }
.a { box-flex: 3; }
A B .b { box-flex: 2; }
13. Flex-box
.child { .outer { box-orient: vertical; }
box-flex: 0; .a,.b { box-ordinal-group: 2; }
box-align: center;
box-pack: center; .c { box-ordinal-group: 1; }
}
C
A
B
15. Flex-box
display: box → display: flexbox
box-flex → flex()
box-orient → flex-direction
box-ordinal-group → flex-order
Spec: http://www.w3.org/TR/css3-flexbox/
17. TEMPLATE LAYOUT
.a { position: a; }
.b { position: b; } .outer { display: 'abc'; }
.c { position: c; }
A
B A B C
C
19. TEMPLATE LAYOUT
JS Shim: http://code.google.com/p/css-template-layout/
Demos: http://nealgrosskopf.com/tech/thread.php?pid=46
21. grid LAYOUT
div { div {
display: grid; display: grid;
grid-columns: 1fr 1fr 2fr; grid-columns: 1fr 1fr 2fr;
} grid-rows: 10em auto 40px;
}
22. grid LAYOUT
.child { .a {
grid-column: 2; grid-column: 2;
grid-row: 2; grid-column-span: 2;
} }
.b { grid-row-span: 3; }
A
B
23. grid LAYOUT
Spec: http://www.w3.org/TR/css3-grid-layout/
Blog post: http://j.mp/kul0H1
http://blogs.msdn.com/b/ie/archive/2011/04/14/ie10-platform-preview-and-css-features-for-adaptive-layouts.aspx
24. GRiD LAYOUT
.outer {
grid-template: 'abc';
}
A B C .a { grid-cell: a; }
.b { grid-cell: b; }
.c { grid-cell: c; }
26. EXTENDED FLOATS
.a {
float: positioned;
position: absolute;
left: 33.3%;
A top: 33.33%;
width: 33.3%;
}
Spec: http://www.interoperabilitybridges.com/css3-floats/
28. REGiONS: THREADS
.a { flow: 'foo'; } .b, .c, .d {
.b { content: from(foo); } content: from(foo);
}
A
B
B
C D
32. REGiONS: exclusions
.a { wrap-shape-mode: content; }
.b {
wrap-shape: polygon(150px,0 0,300px 300px,300px);
wrap-shape-mode: around;
}
34. regions
Spec: http://dev.w3.org/csswg/css3-regions/
Prototype: http://labs.adobe.com/technologies/cssregions/
Pro tip: use http://leo-koppelkamm.de/polyCreator/ for
creating polygons.