/
test.html
executable file
·196 lines (194 loc) · 16.9 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB">
<head>
<title>The Perfect 3 Column Liquid Layout: No CSS hacks. SEO friendly. iPhone compatible.</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<meta name="description" content="The Perfect 3 Column Liquid Layout: No CSS hacks. SEO friendly. iPhone compatible." />
<meta name="keywords" content="The Perfect 3 Column Liquid Layout: No CSS hacks. SEO friendly. iPhone compatible." />
<meta name="robots" content="index, follow" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="screen.css" media="screen" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="imagegallery.css">
</head>
<body>
<div id="header">
<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>
<h1>The Perfect 3 Column Liquid Layout (Percentage widths)</h1>
<h2>No CSS hacks. SEO friendly. No Images. No JavaScript. Cross-browser & iPhone compatible.</h2>
<ul>
<li><a href="http://matthewjamestaylor.com/blog/perfect-3-column.htm" class="active">3 Column <span>Holy Grail</span></a></li>
<li><a href="http://matthewjamestaylor.com/blog/perfect-3-column-blog-style.htm">3 Column <span>Blog Style</span></a></li>
<li><a href="http://matthewjamestaylor.com/blog/perfect-2-column-left-menu.htm">2 Column <span>Left Menu</span></a></li>
<li><a href="http://matthewjamestaylor.com/blog/perfect-2-column-right-menu.htm">2 Column <span>Right Menu</span></a></li>
<li><a href="http://matthewjamestaylor.com/blog/perfect-2-column-double-page.htm">2 Column <span>Double Page</span></a></li>
<li><a href="http://matthewjamestaylor.com/blog/perfect-full-page.htm">1 Column <span>Full Page</span></a></li>
<li><a href="http://matthewjamestaylor.com/blog/perfect-stacked-columns.htm">Stacked <span>columns</span></a></li>
</ul>
<p id="layoutdims">Measure columns in: <a href="http://matthewjamestaylor.com/blog/ultimate-3-column-holy-grail-pixels.htm">Pixel widths</a> | <a href="http://matthewjamestaylor.com/blog/ultimate-3-column-holy-grail-ems.htm">Em widths</a> | <strong>Percentage widths</strong></p>
</div>
<div class="colmask threecol">
<div class="colmid">
<div class="colleft">
<div class="col1">
<!-- Column 1 start -->
<h2>Percentage dimensions of the holy grail layout</h2>
<img src="perfect-3-column-dimensions.gif" width="350" height="370" alt="Three column layout dimensions" />
<p>All the dimensions are in percentage widths so the layout adjusts to any screen resolution. Vertical dimensions are not set so they stretch to the height of the content.</p>
<h3>Maximum column content widths</h3>
<p>To prevent wide content (like long URLs) from destroying the layout (long content can make the page scroll horizontally) the column content divs are set to overflow:hidden. This chops off any content that is wider than the div. Because of this, it's important to know the maximum widths allowable at common screen resolutions. For example, if you choose 800 x 600 pixels as your minimum compatible resolution what is the widest image that can be safely added to each column before it gets chopped off? Here are the figures:</p>
<dl>
<dt><strong>800 x 600</strong></dt>
<dd>Left & right columns: 162 pixels</dd>
<dd>Center page: 357 pixels</dd>
<dt><strong>1024 x 768</strong></dt>
<dd>Left & right columns: 210 pixels</dd>
<dd>Center page: 459 pixels</dd>
</dl>
<h2>The nested div structure</h2>
<p>I've colour coded each div so it's easy to see:</p>
<img src="perfect-3-column-div-structure.gif" width="350" height="369" alt="Three column layout nested div structure" />
<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 three column content divs (col1, col2 & col3) are inside colleft. Notice that the main content column (col1) comes before the other columns.</p>
<!-- Column 1 end -->
</div>
<div class="col2">
<ul id="imgList" style="display:none;">
<li>
<a href="images/Fractional Currency Shield.jpg" title="Fractional Currency Shield. Fractional currency shields such as this were produced by the US Treasury between June 1866 and May 1869. The Treasury planned to place them in banks where they would be used to authenticate the fractional paper money then in circulation. Because banks were expected to purchase the shields they were never widely distributed." name="Fractional Currency Shield">
<img src="images/Fractional Currency Shield.jpg" width="1024" height="1201" alt="Name" />
</a>
</li>
<li>
<a href="images/Sport Touring.jpg" title="This watercolor of a 1929 Marmon automobile is the work of Charles Hubbell (1898-1971) of Cleveland. Hubbell would go on to a career as a nationally noted aviation artist, perhaps, best recognized for the aviation calendars he produced for Thompson Products/TRW." name="Sport Touring">
<img src="images/Sport Touring.jpg" width="1024" height="514" alt="Name" />
</a>
</li>
<li>
<a href="images/Tomlinson Hall.jpg" title="This architectural rendering (1945) of Tomlinson Hall on the CWRU campus is from the studio of Walker and Weeks. Walker and Weeks was one of Cleveland's most notable architectural firms. Its works, executed largely between the 1910s and 1950s form a substantial part of the city's architectural legacy. " name="Tomlinson Hall">
<img src="images/Tomlinson Hall.jpg" width="1024" height="511" alt="Name" />
</a>
</li>
<li>
<a href="images/Phillis Wheatley.jpg" title="Phillis Wheatley (1753-1784) was the first published African-American poet. Born a slave, Wheatley would become free in 1773; her freedom being a consequence of the popularity of her works in both the American colonies and England." name="Phillis Wheatley">
<img src="images/Phillis Wheatley.jpg" width="1024" height="1254" alt="Name" />
</a>
</li>
<li>
<a href="images/StElizabeths.jpg" title="Kalman Kubinyi (1906-1973) was considered as Cleveland's preeminent print maker. This print of St. Elizabeth's Church on lower Buckeye Road reflects upon Kubinyi's heritage as he was born in the Hungarian community in the Buckeye neighborhood." name="St. Elizabeth's">
<img src="images/StElizabeths.jpg" width="1024" height="1402" alt="Name" />
</a>
</li>
<li>
<a href="images/Strike.jpg" title="Grant Hamilton (1862-1926) was a political cartoonist best known for his work relating to the elections in the 1890s and early 1900s. This cartoon, which focuses on Democratic Presidential candidate William Jennings Bryan and the free silver issue is typical of his work at that time, which in the main, promoted the candidates and platforms of the Republican Party." name="Strike">
<img src="images/Strike.jpg" width="1024" height="730" alt="Name" />
</a>
</li>
<li>
<a href="images/Strike that Failed.jpg" title="During World War II, the CIO made several attempts to organize the workers at Thompson Products (later to become TRW, Inc.). The Cleveland-based company, headed by Frederick C. Crawford, had its own, internal labor union and each organizational drive was defeated. This cartoon reflects on the patriotic motives of the workers in refusing to join the CIO. " name="Strike that Failed">
<img src="images/Strike that Failed.jpg" width="1024" height="1288" alt="Name" />
</a>
</li>
<li>
<a href="images/Pyramid of Capitalist System.jpg" title="The Socialist Party was a highly visible part of Cleveland's political scene during the late nineteenth and early twentieth centuries. These two prints, both dating from 1912, were issued by the International Publishing Company in Cleveland. One depicts the "Pyramid of the Capitalist System", a common motif of the party and radical politics. The second image, "The Last Strike", is less typical and rather complex in style and symbolism." name="Pyramid of Capitalist System">
<img src="images/Pyramid of Capitalist System.jpg" width="1024" height="1263" alt="Name" />
</a>
</li>
<li>
<a href="images/Last strike.jpg" title="The Socialist Party was a highly visible part of Cleveland's political scene during the late nineteenth and early twentieth centuries. These two prints, both dating from 1912, were issued by the International Publishing Company in Cleveland. One depicts the "Pyramid of the Capitalist System", a common motif of the party and radical politics. The second image, "The Last Strike", is less typical and rather complex in style and symbolism." name="Last strike">
<img src="images/Last strike.jpg" width="1024" height="812" alt="Name" />
</a>
</li>
<li>
<a href="images/First Church of Christ.jpg" title="The First Church of Christ Scientist on Overlook Road is one of the most significant works designed by Walker and Weeks of Cleveland. The two renderings show the exteriors of the main auditorium of the church and its landmark tower. Architectural historians have noted that the auditorium's design, in part, mirrors that of Severance Hall, which was also designed by the firm. Both structures opened in 1931. Today the building serves as the headquarters for Nottingham-Spirk design associates." name="First Church of Christ">
<img src="images/First Church of Christ.jpg" width="1024" height="589" alt="Name" />
</a>
</li>
<li>
<a href="images/First Church of Christ Tower.jpg" title="The First Church of Christ Scientist on Overlook Road is one of the most significant works designed by Walker and Weeks of Cleveland. The two renderings show the exteriors of the main auditorium of the church and its landmark tower. Architectural historians have noted that the auditorium's design, in part, mirrors that of Severance Hall, which was also designed by the firm. Both structures opened in 1931. Today the building serves as the headquarters for Nottingham-Spirk design associates." name="First Church of Christ Tower">
<img src="images/First Church of Christ Tower.jpg" width="1024" height="2003" alt="Name" />
</a>
</li>
<li>
<a href="images/Brush Electric Company.jpg" title="This lithograph depicts the Brush Electric Company plant at what is now Commerce and E. 45th St. in Cleveland. Formed by Charles F. Brush (1849-1929) in 1880 the company produced the dynamos and arc lighting systems which he had invented. Brush Electric would eventually merge with Edison General Electric to form the General Electric Co." name="Brush Electric Company">
<img src="images/Brush Electric Company.jpg" width="1024" height="822" alt="Name" />
</a>
</li>
<li>
<a href="images/Operative Society Bricklayers.jpg" title="This certificate (1880) which admits William Feasey to membership in the Operational Society of Bricklayers is both an elaborate example of lithography and a testament to the status of the skilled trades during the late nineteenth century. " name="Operative Society Bricklayers">
<img src="images/Operative Society Bricklayers.jpg" width="1024" height="1267" alt="Name" />
</a>
</li>
<li>
<a href="images/Funny.jpg" title="James Harrison "Hal" Donahey (1875-1949) was a prolific editorial cartoonist for the Cleveland Plain Dealer for nearly five decades. Almost the full body of his original work is preserved at the Western Reserve Historical Society. This example "Funny, but he never picks up passengers when mother is along" is typical of his style during the 1920s." name="Funny">
<img src="images/Funny.jpg" width="1024" height="1406" alt="Name" />
</a>
</li>
</ul>
<script type="text/javascript" src="imagegallery.js"></script>
<script type="text/javascript">
galleryViewer();
</script>
<!-- Column 2 start -->
<h2>No CSS hacks</h2>
<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 in conjunction with a width. Instead, this design uses percentage widths and clever relative positioning.</p>
<h2>SEO friendly 2-1-3 column ordering</h2>
<p>The higher up content is in your page code, the more important it is considered by search engine algorithms (see my article on <a href="http://matthewjamestaylor.com/blog/link-source-ordering-seo">link source ordering</a> for more details on how this affects links). 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>
<h2>Full length column background colours</h2>
<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! You can read my article on <a href="http://matthewjamestaylor.com/blog/equal-height-columns-cross-browser-css-no-hacks">equal height columns</a> if you want to see how this is done.</p>
<h2>No Images</h2>
<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>
<h2>No JavaScript</h2>
<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. The JavaScript at the bottom of this page is just my Google Analytics tracking code, you can remove this when you use the layout.</p>
<h2>Resizable text compatible</h2>
<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. Is your website text-resizing compatible?</p>
<h2>No Quirks Mode</h2>
<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>
<h2>No IE Conditional Comments</h2>
<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>
<!-- Column 2 end -->
</div>
<div class="col3">
<!-- Column 3 start -->
<div id="ads">
<a href="http://matthewjamestaylor.com">
<img src="mjt-125x125.gif" width="125" border="0" height="125" alt="Art and Design by Matthew James Taylor" />
</a>
</div>
<h2>Browser Compatibility</h2>
<p>This 3 column liquid Layout has been tested on the following browsers:</p>
<h3>iPhone & iPod Touch</h3>
<ul>
<li>Safari</li>
</ul>
<h3>Mac</h3>
<ul>
<li>Safari</li>
<li>Firefox</li>
<li>Opera 9.25</li>
<li>Netscape 9.0.0.5 & 7.1</li>
</ul>
<h3>Windows</h3>
<ul>
<li>Firefox 1.5, 2 & 3</li>
<li>Safari</li>
<li>Opera 8.1 & 9</li>
<li>Google Chrome</li>
<li>Explorer 5.5, 6 & 7</li>
<li>Netscape 8</li>
</ul>
<h2>Valid XHTML strict markup</h2>
<p>The HTML in this layout validates as XHTML 1.0 strict.</p>
<h2>This layout is FREE for anyone to use</h2>
<p>That's right, you don't have to pay anything. If you are feeling generous however, link back to this page so other people can find and use this layout too.</p>
<h2>Centered menus compatible</h2>
<p>This layout is fully compatible with my <a href="http://matthewjamestaylor.com/blog/beautiful-css-centered-menus-no-hacks-full-cross-browser-support">cross-browser compatible centered menus</a>.</p>
<!-- Column 3 end -->
</div>
</div>
</div>
</div>
<div id="footer">
<p>This page uses the <a href="http://matthewjamestaylor.com/blog/perfect-3-column.htm">Perfect '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>
</div>
</body>
</html>