endymion-origami 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/MIT-LICENSE +20 -0
- data/README.textile +138 -0
- data/Rakefile +39 -0
- data/app/helpers/layout_helper.rb +44 -0
- data/app/views/layouts/1_column_em.html.erb +110 -0
- data/app/views/layouts/1_column_percentage.html.erb +127 -0
- data/app/views/layouts/1_column_pixel.html.erb +110 -0
- data/app/views/layouts/2_column_left_menu_em.html.erb +209 -0
- data/app/views/layouts/2_column_left_menu_percentage.html.erb +181 -0
- data/app/views/layouts/2_column_left_menu_pixel.html.erb +216 -0
- data/app/views/layouts/2_column_right_menu_em.html.erb +204 -0
- data/app/views/layouts/2_column_right_menu_percentage.html.erb +227 -0
- data/app/views/layouts/2_column_right_menu_pixel.html.erb +240 -0
- data/app/views/layouts/3_column_blog_em.html.erb +257 -0
- data/app/views/layouts/3_column_blog_percentage.html.erb +255 -0
- data/app/views/layouts/3_column_blog_pixel.html.erb +268 -0
- data/app/views/layouts/3_column_holy_grail_em.html.erb +262 -0
- data/app/views/layouts/3_column_holy_grail_percentage.html.erb +255 -0
- data/app/views/layouts/3_column_holy_grail_pixel.html.erb +262 -0
- data/app/views/layouts/_body.html.erb +7 -0
- data/app/views/layouts/_column_1.html.erb +5 -0
- data/app/views/layouts/_column_2.html.erb +5 -0
- data/app/views/layouts/_column_3.html.erb +5 -0
- data/app/views/layouts/_flashes.html.erb +15 -0
- data/app/views/layouts/_footer.html.erb +5 -0
- data/app/views/layouts/_google_analytics_tracker.html.erb +8 -0
- data/app/views/layouts/_head.html.erb +23 -0
- data/app/views/layouts/_header.html.erb +5 -0
- data/app/views/layouts/_image_replacement.html.erb +3 -0
- data/app/views/layouts/_javascript_includes.html.erb +1 -0
- data/app/views/layouts/_layout_and_theme_stylesheets.html.erb +8 -0
- data/app/views/layouts/stacked_columns.html.erb +418 -0
- data/assets/bluetrip-css-framework/LICENSE +312 -0
- data/assets/bluetrip-css-framework/README.rst +37 -0
- data/assets/bluetrip-css-framework/css/ie.css +21 -0
- data/assets/bluetrip-css-framework/css/print.css +49 -0
- data/assets/bluetrip-css-framework/css/screen.css +409 -0
- data/assets/bluetrip-css-framework/css/style.css +7 -0
- data/assets/bluetrip-css-framework/examples/grid.html +232 -0
- data/assets/bluetrip-css-framework/examples/index.html +263 -0
- data/assets/bluetrip-css-framework/examples/test-small.jpg +0 -0
- data/assets/bluetrip-css-framework/img/grid.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/cross.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/doc.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/email.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/external.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/feed.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/im.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/information.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/key.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/pdf.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/tick.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/visited.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/xls.png +0 -0
- data/init.rb +1 -0
- data/install.rb +1 -0
- data/lib/chaise.rb +9 -0
- data/origami.gemspec +118 -0
- data/public/stylesheets/1_column_em.css +117 -0
- data/public/stylesheets/1_column_percentage.css +134 -0
- data/public/stylesheets/1_column_pixel.css +117 -0
- data/public/stylesheets/2_column_left_menu_em.css +149 -0
- data/public/stylesheets/2_column_left_menu_percentage.css +142 -0
- data/public/stylesheets/2_column_left_menu_pixel.css +149 -0
- data/public/stylesheets/2_column_right_menu_em.css +148 -0
- data/public/stylesheets/2_column_right_menu_percentage.css +142 -0
- data/public/stylesheets/2_column_right_menu_pixel.css +148 -0
- data/public/stylesheets/3_column_blog_pixel.css +162 -0
- data/rails/init.rb +1 -0
- data/rdoc/classes/ApplicationController.html +151 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/README_textile.html +363 -0
- data/rdoc/files/lib/chaise_rb.html +101 -0
- data/rdoc/fr_class_index.html +27 -0
- data/rdoc/fr_file_index.html +28 -0
- data/rdoc/fr_method_index.html +27 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/tasks/chaise_tasks.rake +15 -0
- data/test/chaise_test.rb +26 -0
- data/test/test_helper.rb +3 -0
- data/uninstall.rb +1 -0
- metadata +136 -0
@@ -0,0 +1,262 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
4
|
+
<head>
|
5
|
+
<title>The Holy Grail 3 column Liquid Layout. Pixel widths. Cross-Browser. Equal Height Columns.</title>
|
6
|
+
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
|
7
|
+
<meta name="description" content="The Holy Grail 3 column Liquid Layout. Pixel widths. Cross-Browser. Equal Height Columns." />
|
8
|
+
<meta name="keywords" content="The Holy Grail 3 column Liquid Layout. Pixel widths. Cross-Browser. Equal Height Columns." />
|
9
|
+
<meta name="robots" content="index, follow" />
|
10
|
+
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
11
|
+
<style media="screen" type="text/css">
|
12
|
+
/* <!-- */
|
13
|
+
/* General styles */
|
14
|
+
body {
|
15
|
+
margin:0;
|
16
|
+
padding:0;
|
17
|
+
border:0; /* This removes the border around the viewport in old versions of IE */
|
18
|
+
width:100%;
|
19
|
+
background:#fff;
|
20
|
+
min-width:600px; /* Minimum width of layout - remove line if not required */
|
21
|
+
/* The min-width property does not work in old versions of Internet Explorer */
|
22
|
+
}
|
23
|
+
/* Header styles */
|
24
|
+
#header {
|
25
|
+
clear:both;
|
26
|
+
float:left;
|
27
|
+
width:100%;
|
28
|
+
}
|
29
|
+
#header {
|
30
|
+
border-bottom:1px solid #000;
|
31
|
+
}
|
32
|
+
#header p,
|
33
|
+
#header h1,
|
34
|
+
#header h2 {
|
35
|
+
padding:.4em 15px 0 15px;
|
36
|
+
margin:0;
|
37
|
+
}
|
38
|
+
#header ul {
|
39
|
+
clear:left;
|
40
|
+
float:left;
|
41
|
+
width:100%;
|
42
|
+
list-style:none;
|
43
|
+
margin:10px 0 0 0;
|
44
|
+
padding:0;
|
45
|
+
}
|
46
|
+
#header ul li {
|
47
|
+
display:inline;
|
48
|
+
list-style:none;
|
49
|
+
margin:0;
|
50
|
+
padding:0;
|
51
|
+
}
|
52
|
+
#header ul li a {
|
53
|
+
display:block;
|
54
|
+
float:left;
|
55
|
+
margin:0 0 0 1px;
|
56
|
+
padding:3px 10px;
|
57
|
+
text-align:center;
|
58
|
+
background:#eee;
|
59
|
+
color:#000;
|
60
|
+
text-decoration:none;
|
61
|
+
position:relative;
|
62
|
+
left:15px;
|
63
|
+
line-height:1.3em;
|
64
|
+
}
|
65
|
+
#header ul li a:hover {
|
66
|
+
background:#369;
|
67
|
+
color:#fff;
|
68
|
+
}
|
69
|
+
#header ul li a.active,
|
70
|
+
#header ul li a.active:hover {
|
71
|
+
color:#fff;
|
72
|
+
background:#000;
|
73
|
+
font-weight:bold;
|
74
|
+
}
|
75
|
+
#header ul li a span {
|
76
|
+
display:block;
|
77
|
+
}
|
78
|
+
/* 'widths' sub menu */
|
79
|
+
#layoutdims {
|
80
|
+
clear:both;
|
81
|
+
background:#eee;
|
82
|
+
border-top:4px solid #000;
|
83
|
+
margin:0;
|
84
|
+
padding:6px 15px !important;
|
85
|
+
text-align:right;
|
86
|
+
}
|
87
|
+
/* column container */
|
88
|
+
.colmask {
|
89
|
+
position:relative; /* This fixes the IE7 overflow hidden bug and stops the layout jumping out of place */
|
90
|
+
clear:both;
|
91
|
+
float:left;
|
92
|
+
width:100%; /* width of whole page */
|
93
|
+
overflow:hidden; /* This chops off any overhanging divs */
|
94
|
+
}
|
95
|
+
/* holy grail 3 column settings */
|
96
|
+
.holygrail {
|
97
|
+
background:#ff9; /* Right column background colour */
|
98
|
+
}
|
99
|
+
.holygrail .colmid {
|
100
|
+
float:left;
|
101
|
+
width:200%;
|
102
|
+
margin-left:-200px; /* Width of right column */
|
103
|
+
position:relative;
|
104
|
+
right:100%;
|
105
|
+
background:#fff; /* Centre column background colour */
|
106
|
+
}
|
107
|
+
.holygrail .colleft {
|
108
|
+
float:left;
|
109
|
+
width:100%;
|
110
|
+
margin-left:-50%;
|
111
|
+
position:relative;
|
112
|
+
left:400px; /* Left column width + right column width */
|
113
|
+
background:#FFD8B7; /* Left column background colour */
|
114
|
+
}
|
115
|
+
.holygrail .col1wrap {
|
116
|
+
float:left;
|
117
|
+
width:50%;
|
118
|
+
position:relative;
|
119
|
+
right:200px; /* Width of left column */
|
120
|
+
padding-bottom:1em; /* Centre column bottom padding. Leave it out if it's zero */
|
121
|
+
}
|
122
|
+
.holygrail .col1 {
|
123
|
+
margin:0 215px; /* Centre column side padding:
|
124
|
+
Left padding = left column width + centre column left padding width
|
125
|
+
Right padding = right column width + centre column right padding width */
|
126
|
+
position:relative;
|
127
|
+
left:200%;
|
128
|
+
overflow:hidden;
|
129
|
+
}
|
130
|
+
.holygrail .col2 {
|
131
|
+
float:left;
|
132
|
+
float:right; /* This overrides the float:left above */
|
133
|
+
width:170px; /* Width of left column content (left column width minus left and right padding) */
|
134
|
+
position:relative;
|
135
|
+
right:15px; /* Width of the left-had side padding on the left column */
|
136
|
+
}
|
137
|
+
.holygrail .col3 {
|
138
|
+
float:left;
|
139
|
+
float:right; /* This overrides the float:left above */
|
140
|
+
width:170px; /* Width of right column content (right column width minus left and right padding) */
|
141
|
+
margin-right:45px; /* Width of right column right-hand padding + left column left and right padding */
|
142
|
+
position:relative;
|
143
|
+
left:50%;
|
144
|
+
}
|
145
|
+
/* Footer styles */
|
146
|
+
#footer {
|
147
|
+
clear:both;
|
148
|
+
float:left;
|
149
|
+
width:100%;
|
150
|
+
border-top:1px solid #000;
|
151
|
+
}
|
152
|
+
#footer p {
|
153
|
+
padding:10px;
|
154
|
+
margin:0;
|
155
|
+
}
|
156
|
+
/* --> */
|
157
|
+
</style>
|
158
|
+
<!--[if lt IE 7]>
|
159
|
+
<style media="screen" type="text/css">
|
160
|
+
.col1 {
|
161
|
+
width:100%;
|
162
|
+
}
|
163
|
+
</style>
|
164
|
+
<![endif]-->
|
165
|
+
</head>
|
166
|
+
<body>
|
167
|
+
|
168
|
+
<div id="header">
|
169
|
+
<p><a href="http://matthewjamestaylor.com/blog/ultimate-multi-column-liquid-layouts-em-and-pixel-widths" title="Ultimate multi-column liquid layouts (em and pixel widths)">« Back to the CSS article</a> by <a href="http://matthewjamestaylor.com">Matthew James Taylor</a></p>
|
170
|
+
<h1>The 'Holy Grail' 3 column Liquid Layout (Pixel-widths)</h1>
|
171
|
+
<h2>No CSS hacks. SEO friendly 2-1-3 column order. Cross-browser. Equal height columns.</h2>
|
172
|
+
<ul>
|
173
|
+
<li><a href="http://matthewjamestaylor.com/blog/ultimate-3-column-holy-grail-pixels.htm" class="active">3 Column <span>Holy Grail</span></a></li>
|
174
|
+
<li><a href="http://matthewjamestaylor.com/blog/ultimate-3-column-blog-style-pixels.htm">3 Column <span>Blog Style</span></a></li>
|
175
|
+
<li><a href="http://matthewjamestaylor.com/blog/ultimate-2-column-left-menu-pixels.htm">2 Column <span>Left Menu</span></a></li>
|
176
|
+
<li><a href="http://matthewjamestaylor.com/blog/ultimate-2-column-right-menu-pixels.htm">2 Column <span>Right Menu</span></a></li>
|
177
|
+
<li><a href="http://matthewjamestaylor.com/blog/ultimate-1-column-full-page-pixels.htm">1 Column <span>Full Page</span></a></li>
|
178
|
+
<li><a href="http://matthewjamestaylor.com/blog/ultimate-stacked-columns-pixels.htm">Stacked <span>Columns</span></a></li>
|
179
|
+
</ul>
|
180
|
+
<p id="layoutdims">Measure columns in: <strong>Pixel widths</strong> | <a href="http://matthewjamestaylor.com/blog/ultimate-3-column-holy-grail-ems.htm">Em widths</a> | <a href="http://matthewjamestaylor.com/blog/perfect-3-column.htm">Percentage widths</a></p>
|
181
|
+
</div>
|
182
|
+
<div class="colmask holygrail">
|
183
|
+
<div class="colmid">
|
184
|
+
<div class="colleft">
|
185
|
+
<div class="col1wrap">
|
186
|
+
<div class="col1">
|
187
|
+
<!-- Column 1 start -->
|
188
|
+
<h2>Pixel dimensions of the holy grail layout</h2>
|
189
|
+
<img src="http://matthewjamestaylor.com/blog/ultimate-3-column-holy-grail-pixels-dimensions.gif" width="350" height="370" alt="The holy grail 3 column layout dimensions" />
|
190
|
+
<p>In this layout the side column widths are in pixels and the centre page adjusts in size to fill the rest of the screen. Vertical dimensions are left unset so they automatically stretch to the height of the content. Layouts that use pixel widths are great for images because you can make them fit perfectly within a column without gaps.</p>
|
191
|
+
<h2>The nested div structure</h2>
|
192
|
+
<p>I've colour coded each div so it's easy to see:</p>
|
193
|
+
<img src="http://matthewjamestaylor.com/blog/ultimate-3-column-holy-grail-div-structure.gif" width="350" height="369" alt="The holy grail 3 column layout nested div structure" />
|
194
|
+
<p>The header, colmask and footer divs are 100% wide and stacked vertically one after the other. Colmid is inside colmask and colleft is inside colmid. The left and right content columns are inside colleft. The center column needs to be inside the col1wrap div so it can be positioned correctly (This extra div is not required on the <a href="perfect-3-column.htm">percentage width version</a>). Notice that the main content column (col1) comes before the other columns, this is great for SEO.</p>
|
195
|
+
<p>Try my <a href="http://matthewjamestaylor.com/blog/holy-grail-liquid-layout-no-quirks-mode">Quirks-mode free and IE conditional comments free</a> version of this layout.</p>
|
196
|
+
<!-- Column 1 end -->
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
<div class="col2">
|
200
|
+
<!-- Column 2 start -->
|
201
|
+
<h2>No CSS hacks</h2>
|
202
|
+
<p>The CSS used for this layout is 100% valid and hack free. To overcome Internet Explorer's broken box model, no horizontal padding or margins are used. Instead, this design uses pixel widths and clever relative positioning.</p>
|
203
|
+
<h2>SEO friendly 2-1-3 column ordering</h2>
|
204
|
+
<p>The higher up content is in your page code, the more important it is considered by search engine algorithms. To make your website as optimised as possible your main page content must come before the side columns. This layout does exactly that: The center page comes first, then the left column and finally the right column (see the nested div structure diagram for more info). The columns can also be configured to any other order if required.</p>
|
205
|
+
<h2>Equal height columns</h2>
|
206
|
+
<p>It doesn't matter which column has the longest content, the background colour of all columns will stretch down to meet the footer. This feature was traditionally only available with table based layouts but now with a little CSS trickery we can do exactly the same with divs. Say goodbye to annoying short columns!</p>
|
207
|
+
<h2>No Images</h2>
|
208
|
+
<p>This layout requires no images. Many CSS website designs need images to colour in the column backgrounds but that is not necessary with this design. Why waste bandwidth and precious HTTP requests when you can do everything in pure CSS and XHTML?</p>
|
209
|
+
<h2>No JavaScript</h2>
|
210
|
+
<p>JavaScript is not required. Some website layouts rely on JavaScript hacks to resize divs and force elements into place but you won't see any of that nonsense here.</p>
|
211
|
+
<!-- Column 2 end -->
|
212
|
+
</div>
|
213
|
+
<div class="col3">
|
214
|
+
<!-- Column 3 start -->
|
215
|
+
<h2>Full cross-browser support</h2>
|
216
|
+
<p>The holy grail 3 column liquid Layout has been tested on the following browsers:</p>
|
217
|
+
|
218
|
+
<h3>iPhone & iPod Touch</h3>
|
219
|
+
<ul>
|
220
|
+
<li>Safari</li>
|
221
|
+
</ul>
|
222
|
+
<h3>Mac</h3>
|
223
|
+
<ul>
|
224
|
+
<li>Safari</li>
|
225
|
+
<li>Firefox</li>
|
226
|
+
<li>Opera 9.25</li>
|
227
|
+
<li>Netscape 9.0.0.5 & 7.1</li>
|
228
|
+
</ul>
|
229
|
+
<h3>Windows</h3>
|
230
|
+
<ul>
|
231
|
+
<li>Firefox 1.5 & 2</li>
|
232
|
+
<li>Safari</li>
|
233
|
+
<li>Opera 8.1 & 9</li>
|
234
|
+
<li>Explorer 5.5, 6 & 7</li>
|
235
|
+
<li>Netscape 8</li>
|
236
|
+
</ul>
|
237
|
+
<h2>Valid XHTML strict markup</h2>
|
238
|
+
<p>The HTML in this layout validates as XHTML 1.0 strict.</p>
|
239
|
+
<h2>Resizable text compatible</h2>
|
240
|
+
<p>This layout is fully compatible with resizable text. Resizable text is important for web accessibility. People who are vision impaired can make the text larger so it's easier for them to read. It is becoming increasingly more important to make your website resizable text compatible because people are expecting higher levels of web accessibility. Apple have made resizing the text on a website simple with the pinch gesture on their multi-touch trackpad. So far this trackpad is only available on the MacBook Air but it will soon be rolled out to all of their systems. Is your website text-resizing compatible?</p>
|
241
|
+
<h2>This layout is FREE for anyone to use</h2>
|
242
|
+
<p>You don't have to pay anything. Simply view the source of this page and save the HTML onto your computer. My only suggestion is to put the CSS into a separate file. If you are feeling generous however, link back to this page so other people can find and use this layout too.</p>
|
243
|
+
<h2>Free traffic for your website</h2>
|
244
|
+
<p>If you use this layout for your website <a href="http://matthewjamestaylor.com/about">send me an email</a> with the link and I'll add you to my list of example sites. Once your link is published you'll get free traffic!</p>
|
245
|
+
<!-- Column 3 end -->
|
246
|
+
</div>
|
247
|
+
</div>
|
248
|
+
</div>
|
249
|
+
</div>
|
250
|
+
<div id="footer">
|
251
|
+
<p>This page uses the <a href="http://matthewjamestaylor.com/blog/ultimate-3-column-holy-grail-pixels.htm">Ultimate 'Holy Grail' 3 column Liquid Layout</a> by <a href="http://matthewjamestaylor.com">Matthew James Taylor</a>. View more <a href="http://matthewjamestaylor.com/blog/-website-layouts">website layouts</a> and <a href="http://matthewjamestaylor.com/blog/-web-design">web design articles</a>.</p>
|
252
|
+
</div>
|
253
|
+
|
254
|
+
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
255
|
+
</script>
|
256
|
+
<script type="text/javascript">
|
257
|
+
_uacct = "UA-1848067-8";
|
258
|
+
urchinTracker();
|
259
|
+
</script>
|
260
|
+
|
261
|
+
</body>
|
262
|
+
</html>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div id="flash">
|
2
|
+
<% flash.each do |key, value| -%>
|
3
|
+
<p id="flash_<%= key -%>" class="<%= key -%>">
|
4
|
+
<%= case key
|
5
|
+
when 'success':
|
6
|
+
image_tag 'bluetrip/icons/tick.png'
|
7
|
+
when 'error':
|
8
|
+
image_tag 'bluetrip/icons/cross.png'
|
9
|
+
when 'notice':
|
10
|
+
image_tag 'bluetrip/icons/key.png'
|
11
|
+
end -%>
|
12
|
+
<%= html_escape(value) -%>
|
13
|
+
</p>
|
14
|
+
<% end -%>
|
15
|
+
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<head>
|
2
|
+
<title><%= defined?(TITLE) ? TITLE : 'Untitled' %></title>
|
3
|
+
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
|
4
|
+
<% if defined?(DESCRIPTION) -%>
|
5
|
+
<meta name="description" content="<%= DESCRIPTION %>" />
|
6
|
+
<% end -%>
|
7
|
+
<% if defined?(KEYWORDS) -%>
|
8
|
+
<meta name="keywords" content="<%= KEYWORDS %>" />
|
9
|
+
<% end -%>
|
10
|
+
<% if defined?(ICON) -%>
|
11
|
+
<link rel="shortcut icon" href="<%= ICON %>" type="image/x-icon" />
|
12
|
+
<% end -%>
|
13
|
+
<% if defined?(WIDTH) -%>
|
14
|
+
<meta name = "viewport" content = "width = <%= WIDTH %>"/>
|
15
|
+
<% end -%>
|
16
|
+
<meta name="robots" content="index, follow" />
|
17
|
+
|
18
|
+
<%= stylesheet_link_tag 'screen', :media => 'screen, projection' %>
|
19
|
+
<%= stylesheet_link_tag 'style', :media => 'screen, projection' %>
|
20
|
+
<%= stylesheet_link_tag 'print', :media => 'print' %>
|
21
|
+
|
22
|
+
<%= render :partial => 'layouts/javascript_includes' %>
|
23
|
+
</head>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= javascript_include_tag :defaults %>
|
@@ -0,0 +1,418 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB">
|
3
|
+
<head>
|
4
|
+
<title>The Perfect Multi-Column Stacked Liquid Layout: No CSS hacks. SEO friendly. iPhone compatible.</title>
|
5
|
+
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
|
6
|
+
<meta name="description" content="The Perfect Multi-Column Stacked Liquid Layout: No CSS hacks. SEO friendly. iPhone compatible." />
|
7
|
+
<meta name="keywords" content="The Perfect Multi-Column Stacked Liquid Layout: No CSS hacks. SEO friendly. iPhone compatible." />
|
8
|
+
<meta name="robots" content="index, follow" />
|
9
|
+
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
10
|
+
<style media="screen" type="text/css">
|
11
|
+
/* <!-- */
|
12
|
+
/* General styles */
|
13
|
+
body {
|
14
|
+
margin:0;
|
15
|
+
padding:0;
|
16
|
+
border:0; /* This removes the border around the viewport in old versions of IE */
|
17
|
+
width:100%;
|
18
|
+
background:#fff;
|
19
|
+
min-width:600px; /* Minimum width of layout - remove line if not required */
|
20
|
+
/* The min-width property does not work in old versions of Internet Explorer */
|
21
|
+
font-size:90%;
|
22
|
+
}
|
23
|
+
a {
|
24
|
+
color:#369;
|
25
|
+
}
|
26
|
+
a:hover {
|
27
|
+
color:#fff;
|
28
|
+
background:#369;
|
29
|
+
text-decoration:none;
|
30
|
+
}
|
31
|
+
h1, h2, h3 {
|
32
|
+
margin:.8em 0 .2em 0;
|
33
|
+
padding:0;
|
34
|
+
}
|
35
|
+
p {
|
36
|
+
margin:.4em 0 .8em 0;
|
37
|
+
padding:0;
|
38
|
+
}
|
39
|
+
img {
|
40
|
+
margin:10px 0 5px;
|
41
|
+
}
|
42
|
+
/* Header styles */
|
43
|
+
#header {
|
44
|
+
clear:both;
|
45
|
+
float:left;
|
46
|
+
width:100%;
|
47
|
+
}
|
48
|
+
#header {
|
49
|
+
border-bottom:1px solid #000;
|
50
|
+
}
|
51
|
+
#header p,
|
52
|
+
#header h1,
|
53
|
+
#header h2 {
|
54
|
+
padding:.4em 15px 0 15px;
|
55
|
+
margin:0;
|
56
|
+
}
|
57
|
+
#header ul {
|
58
|
+
clear:left;
|
59
|
+
float:left;
|
60
|
+
width:100%;
|
61
|
+
list-style:none;
|
62
|
+
margin:10px 0 0 0;
|
63
|
+
padding:0;
|
64
|
+
}
|
65
|
+
#header ul li {
|
66
|
+
display:inline;
|
67
|
+
list-style:none;
|
68
|
+
margin:0;
|
69
|
+
padding:0;
|
70
|
+
}
|
71
|
+
#header ul li a {
|
72
|
+
display:block;
|
73
|
+
float:left;
|
74
|
+
margin:0 0 0 1px;
|
75
|
+
padding:3px 10px;
|
76
|
+
text-align:center;
|
77
|
+
background:#eee;
|
78
|
+
color:#000;
|
79
|
+
text-decoration:none;
|
80
|
+
position:relative;
|
81
|
+
left:15px;
|
82
|
+
line-height:1.3em;
|
83
|
+
}
|
84
|
+
#header ul li a:hover {
|
85
|
+
background:#369;
|
86
|
+
color:#fff;
|
87
|
+
}
|
88
|
+
#header ul li a.active,
|
89
|
+
#header ul li a.active:hover {
|
90
|
+
color:#fff;
|
91
|
+
background:#000;
|
92
|
+
font-weight:bold;
|
93
|
+
}
|
94
|
+
#header ul li a span {
|
95
|
+
display:block;
|
96
|
+
}
|
97
|
+
/* 'widths' sub menu */
|
98
|
+
#layoutdims {
|
99
|
+
clear:both;
|
100
|
+
background:#eee;
|
101
|
+
border-top:4px solid #000;
|
102
|
+
margin:0;
|
103
|
+
padding:6px 15px !important;
|
104
|
+
text-align:right;
|
105
|
+
}
|
106
|
+
/* column container */
|
107
|
+
.colmask {
|
108
|
+
position:relative; /* This fixes the IE7 overflow hidden bug */
|
109
|
+
clear:both;
|
110
|
+
float:left;
|
111
|
+
width:100%; /* width of whole page */
|
112
|
+
overflow:hidden; /* This chops off any overhanging divs */
|
113
|
+
}
|
114
|
+
/* common column settings */
|
115
|
+
.colleft,
|
116
|
+
.colmid,
|
117
|
+
.colright {
|
118
|
+
float:left;
|
119
|
+
width:100%;
|
120
|
+
position:relative;
|
121
|
+
}
|
122
|
+
.col1,
|
123
|
+
.col2,
|
124
|
+
.col3 {
|
125
|
+
float:left;
|
126
|
+
position:relative;
|
127
|
+
padding:0 0 1em 0;
|
128
|
+
overflow:hidden;
|
129
|
+
}
|
130
|
+
/* 3 Column settings */
|
131
|
+
.threecol {
|
132
|
+
background:#eee; /* right column background colour */
|
133
|
+
}
|
134
|
+
.threecol .colmid {
|
135
|
+
right:25%; /* width of the right column */
|
136
|
+
background:#fff; /* center column background colour */
|
137
|
+
}
|
138
|
+
.threecol .colleft {
|
139
|
+
right:50%; /* width of the middle column */
|
140
|
+
background:#f4f4f4; /* left column background colour */
|
141
|
+
}
|
142
|
+
.threecol .col1 {
|
143
|
+
width:46%; /* width of center column content (column width minus padding on either side) */
|
144
|
+
left:102%; /* 100% plus left padding of center column */
|
145
|
+
}
|
146
|
+
.threecol .col2 {
|
147
|
+
width:21%; /* Width of left column content (column width minus padding on either side) */
|
148
|
+
left:31%; /* width of (right column) plus (center column left and right padding) plus (left column left padding) */
|
149
|
+
}
|
150
|
+
.threecol .col3 {
|
151
|
+
width:21%; /* Width of right column content (column width minus padding on either side) */
|
152
|
+
left:85%; /* Please make note of the brackets here:
|
153
|
+
(100% - left column width) plus (center column left and right padding) plus (left column left and right padding) plus (right column left padding) */
|
154
|
+
}
|
155
|
+
/* 3 Column blog style settings */
|
156
|
+
.blogstyle {
|
157
|
+
background:#eee; /* right column background colour */
|
158
|
+
}
|
159
|
+
.blogstyle .colmid {
|
160
|
+
right:25%; /* width of the right column */
|
161
|
+
background:#f4f4f4; /* center column background colour */
|
162
|
+
}
|
163
|
+
.blogstyle .colleft {
|
164
|
+
right:25%; /* width of the middle column */
|
165
|
+
background:#fff; /* left column background colour */
|
166
|
+
}
|
167
|
+
.blogstyle .col1 {
|
168
|
+
width:46%; /* width of center column content (column width minus padding on either side) */
|
169
|
+
left:52%; /* 100% plus left padding of center column */
|
170
|
+
}
|
171
|
+
.blogstyle .col2 {
|
172
|
+
width:21%; /* Width of left column content (column width minus padding on either side) */
|
173
|
+
left:56%; /* width of (right column) plus (center column left and right padding) plus (left column left padding) */
|
174
|
+
}
|
175
|
+
.blogstyle .col3 {
|
176
|
+
width:21%; /* Width of right column content (column width minus padding on either side) */
|
177
|
+
left:60%; /* Please make note of the brackets here:
|
178
|
+
(100% - left column width) plus (center column left and right padding) plus (left column left and right padding) plus (right column left padding) */
|
179
|
+
}
|
180
|
+
/* 2 Column (left menu) settings */
|
181
|
+
.leftmenu {
|
182
|
+
background:#fff; /* right column background colour */
|
183
|
+
}
|
184
|
+
.leftmenu .colleft {
|
185
|
+
right:75%; /* right column width */
|
186
|
+
background:#f4f4f4; /* left column background colour */
|
187
|
+
}
|
188
|
+
.leftmenu .col1 {
|
189
|
+
width:71%; /* right column content width */
|
190
|
+
left:102%; /* 100% plus left column left padding */
|
191
|
+
}
|
192
|
+
.leftmenu .col2 {
|
193
|
+
width:21%; /* left column content width (column width minus left and right padding) */
|
194
|
+
left:6%; /* (right column left and right padding) plus (left column left padding) */
|
195
|
+
}
|
196
|
+
/* 2 Column (right menu) settings */
|
197
|
+
.rightmenu {
|
198
|
+
background:#eee; /* right column background colour */
|
199
|
+
}
|
200
|
+
.rightmenu .colleft {
|
201
|
+
right:25%; /* right column width */
|
202
|
+
background:#fff; /* left column background colour */
|
203
|
+
}
|
204
|
+
.rightmenu .col1 {
|
205
|
+
width:71%; /* left column content width (left column width minus left and right padding) */
|
206
|
+
left:27%; /* (right column width) plus (left column left padding) */
|
207
|
+
}
|
208
|
+
.rightmenu .col2 {
|
209
|
+
width:21%; /* right column content width (right column width minus left and right padding) */
|
210
|
+
left:31%; /* (right column width) plus (left column left and right padding) plus (right column left padding) */
|
211
|
+
}
|
212
|
+
/* 2 Column (double page) settings */
|
213
|
+
.doublepage {
|
214
|
+
background:#eee; /* right column background colour */
|
215
|
+
}
|
216
|
+
.doublepage .colleft {
|
217
|
+
right:50%; /* right column width */
|
218
|
+
background:#fff; /* left column background colour */
|
219
|
+
}
|
220
|
+
.doublepage .col1 {
|
221
|
+
width:46%; /* left column content width (column width minus left and right padding) */
|
222
|
+
left:52%; /* right column width plus left column left padding */
|
223
|
+
}
|
224
|
+
.doublepage .col2 {
|
225
|
+
width:46%; /* right column content width (column width minus left and right padding) */
|
226
|
+
left:56%; /* (right column width) plus (left column left and right padding) plus (right column left padding) */
|
227
|
+
}
|
228
|
+
/* Full page settings */
|
229
|
+
.fullpage {
|
230
|
+
background:#fff; /* page background colour */
|
231
|
+
}
|
232
|
+
.fullpage .col1 {
|
233
|
+
width:96%; /* page width minus left and right padding */
|
234
|
+
left:2%; /* page left padding */
|
235
|
+
}
|
236
|
+
/* Footer styles */
|
237
|
+
#footer {
|
238
|
+
clear:both;
|
239
|
+
float:left;
|
240
|
+
width:100%;
|
241
|
+
border-top:1px solid #000;
|
242
|
+
}
|
243
|
+
#footer p {
|
244
|
+
padding:10px;
|
245
|
+
margin:0;
|
246
|
+
}
|
247
|
+
/* --> */
|
248
|
+
</style>
|
249
|
+
</head>
|
250
|
+
<body>
|
251
|
+
|
252
|
+
<div id="header">
|
253
|
+
<p><a href="http://matthewjamestaylor.com/blog/perfect-multi-column-liquid-layouts" title="Perfect multi-column liquid layouts - iPhone compatible">« Back to the CSS article</a> by <a href="http://matthewjamestaylor.com">Matthew James Taylor</a></p>
|
254
|
+
<h1>The Perfect Multi-Column Stacked Liquid Layout</h1>
|
255
|
+
<h2>No CSS hacks. SEO friendly. No Images. No JavaScript. Cross-browser & iPhone compatible.</h2>
|
256
|
+
<ul>
|
257
|
+
<li><a href="http://matthewjamestaylor.com/blog/perfect-3-column.htm">3 Column <span>Holy Grail</span></a></li>
|
258
|
+
<li><a href="http://matthewjamestaylor.com/blog/perfect-3-column-blog-style.htm">3 Column <span>Blog Style</span></a></li>
|
259
|
+
<li><a href="http://matthewjamestaylor.com/blog/perfect-2-column-left-menu.htm">2 Column <span>Left Menu</span></a></li>
|
260
|
+
<li><a href="http://matthewjamestaylor.com/blog/perfect-2-column-right-menu.htm">2 Column <span>Right Menu</span></a></li>
|
261
|
+
<li><a href="http://matthewjamestaylor.com/blog/perfect-2-column-double-page.htm">2 Column <span>Double Page</span></a></li>
|
262
|
+
<li><a href="http://matthewjamestaylor.com/blog/perfect-full-page.htm">1 Column <span>Full Page</span></a></li>
|
263
|
+
<li><a href="http://matthewjamestaylor.com/blog/perfect-stacked-columns.htm" class="active">Stacked <span>columns</span></a></li>
|
264
|
+
</ul>
|
265
|
+
<p id="layoutdims">Measure columns in: <a href="http://matthewjamestaylor.com/blog/ultimate-stacked-columns-pixels.htm">Pixel widths</a> | <a href="http://matthewjamestaylor.com/blog/ultimate-stacked-columns-ems.htm">Em widths</a> | <strong>Percentage widths</strong></p>
|
266
|
+
</div>
|
267
|
+
<div class="colmask threecol">
|
268
|
+
<div class="colmid">
|
269
|
+
<div class="colleft">
|
270
|
+
<div class="col1">
|
271
|
+
<!-- Column 1 start -->
|
272
|
+
<h2>Combining column variations</h2>
|
273
|
+
<p>The five styles of columns in this design series can be combined into new layouts by stacking the columns on top of each other. Any number of columns can be stacked and they can be in any order. The number of possibilities are endless.</p>
|
274
|
+
<p>Simply include the style rules for each type of column layout used on the page. The CSS has been designed so it is easy to add and remove them.</p>
|
275
|
+
<p>See the main page on each column variation for dimensions, nested div structures and positioning.</p>
|
276
|
+
<!-- Column 1 end -->
|
277
|
+
</div>
|
278
|
+
<div class="col2">
|
279
|
+
<!-- Column 2 start -->
|
280
|
+
<h2>No CSS hacks</h2>
|
281
|
+
<p>The CSS used for this layout is 100% valid and hack free. To overcome Internet Explorer's broken box model, no horizontal padding or margins are used. Instead, this design uses percentage widths and clever relative positioning.</p>
|
282
|
+
<!-- Column 2 end -->
|
283
|
+
</div>
|
284
|
+
<div class="col3">
|
285
|
+
<!-- Column 3 start -->
|
286
|
+
<h2>SEO friendly</h2>
|
287
|
+
<p>The higher up content is in your page code, the more important it is considered by search engine algorithms. To make your website as optimised as possible your main page content must come before the side column content. Each of the column stacks follow this principle, see the main page for each one for more information.</p>
|
288
|
+
<!-- Column 3 end -->
|
289
|
+
</div>
|
290
|
+
</div>
|
291
|
+
</div>
|
292
|
+
</div>
|
293
|
+
<div class="colmask blogstyle">
|
294
|
+
<div class="colmid">
|
295
|
+
<div class="colleft">
|
296
|
+
<div class="col1">
|
297
|
+
<!-- Column 1 start -->
|
298
|
+
<h2>Divs versus Classes</h2>
|
299
|
+
<p>There are two main ways to reference a div or any other HTML element from your style-sheet, you can use an id (id="idname") or a class (class="classname") so which one is best? Well the answer is it depends on what you are trying to do.</p>
|
300
|
+
<p>An id must be unique, this means you cannot have two elements on the one page with the same id. So an id is useful for something that never repeats on a page like a header or footer. Classes don't have to be unique so they can be used as many times as necessary. A good example of a repeatable element would be a link style, you can have as many links on a page as you like and they can all look the same by giving them the same class name.</p>
|
301
|
+
<!-- Column 1 end -->
|
302
|
+
</div>
|
303
|
+
<div class="col2">
|
304
|
+
<!-- Column 2 start -->
|
305
|
+
<h2>Use classes for stackable columns</h2>
|
306
|
+
<p>Because the columns in this stackable design can be repeated any number of times we cannot use ids because they would be duplicated. Only classes allow us to repeat the columns as many times as we like. So please keep that in mind if you are modifying this design. Of course if your modified layout does not have repeated columns then you can change some of the classes back to ids.</p>
|
307
|
+
<!-- Column 2 end -->
|
308
|
+
</div>
|
309
|
+
<div class="col3">
|
310
|
+
<!-- Column 3 start -->
|
311
|
+
<h2>Equal height columns</h2>
|
312
|
+
<p>It doesn't matter which column has the longest content in each column stack, the background colour of all columns will stretch down to meet the next stack. This feature was traditionally only available with table based layouts but now with a little CSS trickery we can do exactly the same with divs. Say goodbye to annoying short columns!</p>
|
313
|
+
<!-- Column 3 end -->
|
314
|
+
</div>
|
315
|
+
</div>
|
316
|
+
</div>
|
317
|
+
</div>
|
318
|
+
<div class="colmask leftmenu">
|
319
|
+
<div class="colleft">
|
320
|
+
<div class="col1">
|
321
|
+
<!-- Column 1 start -->
|
322
|
+
<h2>Full length column background colours</h2>
|
323
|
+
<p>In this layout the background colours of each column will always stretch to the length of the longest column. This feature was traditionally only available with table based layouts but now with a little CSS trickery we can do exactly the same with divs. Say goodbye to annoying short columns!</p>
|
324
|
+
<!-- Column 1 end -->
|
325
|
+
</div>
|
326
|
+
<div class="col2">
|
327
|
+
<!-- Column 2 start -->
|
328
|
+
<h2>No JavaScript</h2>
|
329
|
+
<p>JavaScript is not required. Some website layouts rely on JavaScript hacks to resize divs and force elements into place but you won't see any of that nonsense here.</p>
|
330
|
+
<!-- Column 2 end -->
|
331
|
+
</div>
|
332
|
+
</div>
|
333
|
+
</div>
|
334
|
+
<div class="colmask rightmenu">
|
335
|
+
<div class="colleft">
|
336
|
+
<div class="col1">
|
337
|
+
<!-- Column 1 start -->
|
338
|
+
<h2>Good uses of a stacked column layout</h2>
|
339
|
+
<ul>
|
340
|
+
<li><strong>Shopping websites</strong> with merchandised units or products in a grid-like layout.</li>
|
341
|
+
<li><strong>News websites</strong> with stories grouped by genre into separate sections of the page.</li>
|
342
|
+
<li><strong>Large blogs</strong> with lots of different content.</li>
|
343
|
+
<li><strong>Business websites</strong> that need to hold a lot of information on the one page.</li>
|
344
|
+
<li>And many more...</li>
|
345
|
+
</ul>
|
346
|
+
<!-- Column 1 end -->
|
347
|
+
</div>
|
348
|
+
<div class="col2">
|
349
|
+
<!-- Column 2 start -->
|
350
|
+
<h2>No Images</h2>
|
351
|
+
<p>This layout requires no images. Many CSS website designs need images to colour in the column backgrounds but that is not necessary with this design. Why wast bandwidth and precious HTTP requests when you can do everything in pure CSS and XHTML?</p>
|
352
|
+
<!-- Column 2 end -->
|
353
|
+
</div>
|
354
|
+
</div>
|
355
|
+
</div>
|
356
|
+
<div class="colmask doublepage">
|
357
|
+
<div class="colleft">
|
358
|
+
<div class="col1">
|
359
|
+
<!-- Column 1 start -->
|
360
|
+
<h2>Browser Compatibility</h2>
|
361
|
+
<p>This 3 column liquid Layout has been tested on the following browsers:</p>
|
362
|
+
<h3>iPhone & iPod Touch</h3>
|
363
|
+
<ul>
|
364
|
+
<li>Safari</li>
|
365
|
+
</ul>
|
366
|
+
<h3>Mac</h3>
|
367
|
+
<ul>
|
368
|
+
<li>Safari</li>
|
369
|
+
<li>Firefox</li>
|
370
|
+
<li>Opera 9.25</li>
|
371
|
+
<li>Netscape 9.0.0.5 & 7.1</li>
|
372
|
+
</ul>
|
373
|
+
<h3>Windows</h3>
|
374
|
+
<ul>
|
375
|
+
<li>Firefox 1.5, 2 & 3</li>
|
376
|
+
<li>Safari</li>
|
377
|
+
<li>Opera 8.1 & 9</li>
|
378
|
+
<li>Google Chrome</li>
|
379
|
+
<li>Explorer 5.5, 6 & 7</li>
|
380
|
+
<li>Netscape 8</li>
|
381
|
+
</ul>
|
382
|
+
<!-- Column 1 end -->
|
383
|
+
</div>
|
384
|
+
<div class="col2">
|
385
|
+
<!-- Column 2 start -->
|
386
|
+
<h2>Valid XHTML strict markup</h2>
|
387
|
+
<p>The HTML in this layout validates as XHTML 1.0 strict.</p>
|
388
|
+
<h2>Resizable text compatible</h2>
|
389
|
+
<p>This layout is fully compatible with resizable text. Resizable text is important for web accessibility. People who are vision impaired can make the text larger so it's easier for them to read. It is becoming increasingly more important to make your website resizable text compatible because people are expecting higher levels of web accessibility. Apple have made resizing the text on a website simple with the pinch gesture on their multi-touch trackpad. So far this trackpad is only available on the MacBook Air but it will soon be rolled out to all of their systems. Is your website text-resizing compatible?</p>
|
390
|
+
<h2>No Quirks Mode</h2>
|
391
|
+
<p>This liquid layout does not require the XML declaration for it to display correctly in older versions of Internet Explorer. This version works without it and is thus never in quirks mode.</p>
|
392
|
+
<h2>No IE Conditional Comments</h2>
|
393
|
+
<p>Only one stylesheet is used with this layout This means that IE conditional comments are not needed to set extra CSS rules for older versions of Internet Explorer.</p>
|
394
|
+
<!-- Column 2 end -->
|
395
|
+
</div>
|
396
|
+
</div>
|
397
|
+
</div>
|
398
|
+
<div class="colmask fullpage">
|
399
|
+
<div class="col1">
|
400
|
+
<!-- Column 1 start -->
|
401
|
+
<h2>This layout is FREE for anyone to use</h2>
|
402
|
+
<p>That's right, you don't have to pay anything. Simply view the source of this page and save the HTML onto your computer. My only suggestion is to put the CSS into a separate file. If you are feeling generous however, link back to this page so other people can find and use this layout too.</p>
|
403
|
+
<!-- Column 1 end -->
|
404
|
+
</div>
|
405
|
+
</div>
|
406
|
+
<div id="footer">
|
407
|
+
<p><a href="http://matthewjamestaylor.com/about">Contact me</a> if you have any problems, suggestions or questions about this layout. View more <a href="http://matthewjamestaylor.com/blog/-website-layouts">website layouts</a> and <a href="http://matthewjamestaylor.com/blog/-web-design">web design articles</a>.</p>
|
408
|
+
</div>
|
409
|
+
|
410
|
+
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
411
|
+
</script>
|
412
|
+
<script type="text/javascript">
|
413
|
+
_uacct = "UA-1848067-8";
|
414
|
+
urchinTracker();
|
415
|
+
</script>
|
416
|
+
|
417
|
+
</body>
|
418
|
+
</html>
|