<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>zomigi.com &#187; liquid</title>
	<atom:link href="http://zomigi.com/tags/liquid/feed/" rel="self" type="application/rss+xml" />
	<link>http://zomigi.com</link>
	<description>The professional blog of Zoe Mickley Gillenwater</description>
	<lastBuildDate>Thu, 10 May 2012 16:30:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Media queries presentation at indieconf</title>
		<link>http://zomigi.com/blog/media-queries-presentation/</link>
		<comments>http://zomigi.com/blog/media-queries-presentation/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 16:30:40 +0000</pubDate>
		<dc:creator>Zoe Gillenwater</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[Flexible Web Design]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[liquid]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[responsive web design]]></category>
		<category><![CDATA[speaking]]></category>
		<category><![CDATA[Stunning CSS3]]></category>

		<guid isPermaLink="false">http://zomigi.com/?p=621</guid>
		<description><![CDATA[Download the slides for my presentation on CSS3: Using Media Queries to Improve the Web Site Experience for indieconf, as well as get links to related resources on media query techniques, tools, and inspiration.]]></description>
			<content:encoded><![CDATA[<p>Today I had the pleasure of speaking at <a href="http://www.indieconf.com/">indieconf</a>, a conference for independent web developers and designers, right here in my backyard of Raleigh, NC. I talked about the basics of CSS3 media query syntax but focused on the challenges and considerations that go into building a site from scratch with media queries to power the layout. I used the fictional <a href="http://stunningcss3.com/code/bakery/index.html">Little Pea Bakery</a> site from my book <a href="http://stunningcss3.com/"><em>Stunning CSS3</em></a> as a demo for how to adapt the CSS to make better use of the space at different viewport widths. I covered some tips for making your design work on mobile devices and even old versions of IE.</p>
<p>You can view the slides on <a href="http://www.slideshare.net/zomigi/css3-using-media-queries-to-improve-the-web-site-experience">SlideShare</a>, or download the slides here:</p>
<p><a href="/downloads/CSS3-Media-Queries_indieconf_111119.pdf">CSS3: Using media queries to improve the web site experience (PDF, 2.4 mb)</a></p>
<p>Here are several links to related resources, some of which are in the  slides plus many that were not but which I recommend and think you&#8217;ll  find useful.</p>
<h3>Media query articles, tutorials, and tools</h3>
<ul>
<li>&#8220;<a href="http://zomigi.com/blog/essential-considerations-for-crafting-quality-media-queries/">Essential considerations for crafting quality media queries</a>&#8221; by me</li>
<li><a href="http://stunningcss3.com/samples/index.html">Excerpt of Chapter 6 of Stunning CSS3 on media queries</a> by me</li>
<li>&#8220;<a href="http://artequalswork.com/posts/target-first.php">Design for a Target Experience First</a>&#8221; by Nathan C. Ford</li>
<li><a href="http://www.goldilocksapproach.com/">The Goldilocks Approach</a> by Front design agency</li>
<li>&#8220;<a href="http://www.netmagazine.com/features/21-top-tools-responsive-web-design">21 top tools for  responsive web design</a>&#8221; by Denise Jacobs for .net Magazine</li>
<li>&#8220;<a href="http://www.smashingmagazine.com/responsive-web-design-guidelines-tutorials/">Responsive Web Design Guidelines and Tutorials</a>&#8221; by Smashing Magazine</li>
<li>&#8220;<a href="http://dev.opera.com/articles/view/an-introduction-to-meta-viewport-and-viewport/">An introduction to meta viewport and @viewport</a>&#8221; by Andrea Bovens for Dev.Opera</li>
<li>&#8220;<a href="http://www.alaress.com.au/2011/04/developing-for-high-dpi-devices/">Why images appear blurry on mobile devices</a>&#8221; by Christopher Cohen</li>
</ul>
<p><span id="more-621"></span></p>
<h3>Dealing with IE 6-8 support</h3>
<ul>
<li><a href="https://github.com/scottjehl/Respond">Respond</a> script by Scott  Jehl</li>
<li><a href="http://code.google.com/p/css3-mediaqueries-js/">css3-mediaqueries.js</a> script by Wouter van der Graaf</li>
<li>“<a href="http://adactio.com/journal/4494/">Windows mobile media queries</a>” by Jeremy Keith</li>
<li>&#8220;<a href="http://blogs.msdn.com/b/iemobile/archive/2010/12/08/targeting-mobile-optimized-css-at-windows-phone-7.aspx">Targeting mobile-optimized CSS at Windows Phone 7</a>&#8221; by IE Mobile Team</li>
</ul>
<h3>Fluid/liquid layout</h3>
<ul>
<li><a href="http://flexiblewebbook.com/"><em>Flexible Web Design: Creating Liquid and Elastic Layouts with CSS</em></a> book by me</li>
<li>&#8220;<a href="../blog/essential-resources-for-creating-liquid-and-elastic-layouts/">70+ essential resources for creating liquid and elastic layouts</a>&#8221; by me</li>
</ul>
<h3>Media query inspiration</h3>
<ul>
<li><a href="http://mediaqueri.es/">Mediaqueri.es</a> gallery</li>
<li>My media query inspiration bookmarks on <a href="http://delicious.com/pixelsurge/mediaqueries+nicedesign">delicious</a> and <a href="https://gimmebar.com/loves/zomigi/tag/mediaqueries">Gimmebar</a></li>
<li>My liquid layout inspiration bookmarks on <a href="http://delicious.com/pixelsurge/liquid+nicedesign">delicious</a> and <a href="https://gimmebar.com/loves/zomigi/tag/liquid">Gimmebar</a></li>
<li>&#8220;<a href="http://zomigi.com/blog/examples-of-flexible-layouts-with-css3-media-queries/">Examples of flexible layouts with CSS3 media queries</a>&#8221; by me</li>
</ul>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://zomigi.com/blog/essential-considerations-for-crafting-quality-media-queries/' title='Essential considerations for crafting quality media queries'>Essential considerations for crafting quality media queries</a></li>
<li><a href='http://zomigi.com/blog/theres-already-a-book-on-responsive-web-design-want-to-win-it/' title='There&#8217;s already a book on responsive web design. Want to win it?'>There&#8217;s already a book on responsive web design. Want to win it?</a></li>
<li><a href='http://zomigi.com/blog/examples-of-flexible-layouts-with-css3-media-queries/' title='Examples of flexible layouts with CSS3 media queries'>Examples of flexible layouts with CSS3 media queries</a></li>
<li><a href='http://zomigi.com/blog/adobe-max/' title='Adobe MAX slides and resources'>Adobe MAX slides and resources</a></li>
<li><a href='http://zomigi.com/blog/web-directions-usa/' title='Web Directions USA slides and resources'>Web Directions USA slides and resources</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zomigi.com/blog/media-queries-presentation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Examples of flexible layouts with CSS3 media queries</title>
		<link>http://zomigi.com/blog/examples-of-flexible-layouts-with-css3-media-queries/</link>
		<comments>http://zomigi.com/blog/examples-of-flexible-layouts-with-css3-media-queries/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 11:22:17 +0000</pubDate>
		<dc:creator>Zoe Gillenwater</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[liquid]]></category>
		<category><![CDATA[media queries]]></category>
		<category><![CDATA[responsive web design]]></category>
		<category><![CDATA[Stunning CSS3]]></category>

		<guid isPermaLink="false">http://zomigi.com/?p=442</guid>
		<description><![CDATA[Media queries let you to feed different CSS to users based on their viewport size (among other things), allowing you to create even more flexible layouts than ever before. See visual examples of real sites that use CSS3 media queries to make the layout more adaptable to the variety of screen sizes and devices in use today.]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://zomigi.com/blog/adobe-max/">CSS3 presentation</a> that I&#8217;ve given several times over the past year, the part that seems to impress the audience the most is my demonstrations of <a href="http://www.w3.org/TR/css3-mediaqueries/">media queries</a>. I&#8217;m with them. I think media queries are perhaps the most useful and exciting piece of all the great new stuff that&#8217;s new to CSS3.</p>
<p>While creating effective, attractive, <a href="http://zomigi.com/blog/essential-resources-for-creating-liquid-and-elastic-layouts/">flexible layouts</a> that adapt to the user&#8217;s screen size has always been possible, media queries add another layer on top of flexible layouts to make them even more adaptable to an even wider range of sizes, allowing you to really fine-tune the experience for even more users. Media queries allow you to selectively feed styles based on the characteristics of the user&#8217;s display or device, such as how much width is available in the viewport, whether it&#8217;s in portrait or landscape mode, or whether it can display color.</p>
<p>My demonstration of media queries is the fictional <a href="http://stunningcss3.com/code/bakery/index.html">Little Pea Bakery</a> site, created for my book <a href="http://stunningcss3.com"><em>Stunning CSS3: A Project-based Guide to the Latest in CSS</em></a>. Here&#8217;s how it looks for most users (shown here at 990 pixels wide):</p>
<div id="attachment_445" class="wp-caption alignnone" style="width: 363px"><a href="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_bakery1.png"><img class="size-full wp-image-445"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_bakery1.png" alt="" width="353" height="410" /></a><p class="wp-caption-text">The &quot;default&quot; layout seen by most users.</p></div>
<p>It&#8217;s a liquid (also known as fluid) layout so it can adapt to the user&#8217;s screen size, but the design doesn&#8217;t look as good and isn&#8217;t as readable when the viewport width is very narrow or very wide. I used media queries to solve this problem. Here&#8217;s how the page looks over 1200 pixels wide:</p>
<div id="attachment_446" class="wp-caption alignnone" style="width: 510px"><a href="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_bakery2.png"><img class="size-full wp-image-446"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_bakery2.png" alt="" width="500" height="392" /></a><p class="wp-caption-text">The layout for wide screens (over 1200 pixels) adds a third column.</p></div>
<p><span id="more-442"></span>Using a media query and just a few lines of CSS, I was able to easily turn the horizontal navigation bar into a vertical menu in a new third column. This kept the text line lengths from getting too long and making the overall design look too stretched out.</p>
<p>Going in the opposite direction, here&#8217;s what happens to the design under 760 pixels wide:</p>
<div id="attachment_446" class="wp-caption alignnone" style="width: 260px"><a href="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_bakery3.png"><img class="size-full wp-image-446"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_bakery3.png" alt="" width="250" height="564" /></a><p class="wp-caption-text">The layout for narrow screens.</p></div>
<p>We&#8217;re back to two columns, as in the &#8220;base&#8221; layout, but I&#8217;ve made changes to keep the content from appearing too squished and the line lengths getting too short. First, I got rid of the two columns in the introductory text. I also moved the three featured product boxes from sitting side-by-side to stacking on top of each other, moving the icon for each one from the top of the product box to the left side.</p>
<p>A third media query improves the design on small mobile screens, seen here at 480 pixels and 320 pixels:</p>
<div id="attachment_446" class="wp-caption alignnone" style="width: 305px"><a href="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_bakery4.png"><img class="size-full wp-image-446"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_bakery4.png" alt="" width="295" height="897" /></a><p class="wp-caption-text">The layout for very small mobile screens uses only one column.</p></div>
<p>The design is now a single column. The main page heading and introductory text are smaller, as are the product icons.</p>
<p>To see all these changes in action, <a href="http://stunningcss3.com/code/bakery/index.html">view the page yourself</a> and resize the browser window. To see how it was done, check out the CSS embedded in the head of the page. You can learn the full details, of course, by reading <a href="http://stunningcss3.com/samples/index.html">Chapter 6 of <em>Stunning CSS3</em></a>.</p>
<p>For more examples of flexible layouts that use media queries to further enhance the site&#8217;s adaptability, dubbed &#8220;<a href="http://www.alistapart.com/articles/responsive-web-design/">responsive web design</a>&#8221; by Ethan Marcotte, see the following sites. Small screenshots don&#8217;t do them justice, so be sure to click through to the sites and resize your browser window back and forth to get the full effect.</p>
<ul class="list-extended">
<li><a href="http://hicksdesign.co.uk/">Hicksdesign<img class="alignnone size-full wp-image-452"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_hicks.png" alt="" width="500" height="245" /></a></li>
<li><a href="http://2011.uxlondon.com/">UX London<img class="alignnone size-full wp-image-456"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_uxlondon.png" alt="" width="500" height="391" /></a></li>
<li><a href="http://www.stpaulsschool.org.uk/">St. Paul’s School<img class="alignnone size-full wp-image-455"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_stpauls.png" alt="" width="500" height="377" /></a></li>
<li><a href="http://css-tricks.com/">CSS-Tricks<img class="alignnone size-full wp-image-450"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_csstricks.png" alt="" width="500" height="237" /></a></li>
<li><a href="http://yiibu.com/">Yiibu<img class="alignnone size-full wp-image-457"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_yiibu.png" alt="" width="500" height="323" /></a></li>
<li><a href="http://sickdesigner.com/">Sick Designer<img class="alignnone size-full wp-image-453"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_sickdesigner.png" alt="" width="500" height="238" /></a></li>
<li><a href="http://ethanmarcotte.com/">Ethan Marcotte</a></li>
<li><a href="http://simplebits.com/">SimpleBits</a></li>
<li><a href="http://london2010.sciencehackday.com/">Science Hack Day</a></li>
<li><a href="http://www.saltercane.com/">Salter Cane</a></li>
<li><a href="http://huffduffer.com/">Huffduffer</a></li>
<li><a href="http://adactio.com/journal/">Adactio</a></li>
<li><a href="http://mindgarden.de/">mindgarden</a></li>
<li><a href="http://2010.dconstruct.org/">dConstruct 2010</a></li>
<li><a href="http://www.edgeofmyseat.com/">edgeofmyseat.com</a></li>
<li><a href="http://dtott.com/">Daniel T Ott</a></li>
</ul>
<p>All of these sites use liquid layouts, but that&#8217;s not a requirement for using media queries. It&#8217;s also possible to use media queries to essentially create multiple fixed-width layouts that can be switched between on the fly. A few sites that do this are:</p>
<ul class="list-extended">
<li><a href="http://colly.com/">Simon Collison<img class="alignnone size-full wp-image-449"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_colly.png" alt="" width="500" height="282" /></a></li>
<li><a href="http://stream.andycroll.com/">Andy Croll<img class="alignnone size-full wp-image-444"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_andycroll.png" alt="" width="500" height="304" /></a></li>
<li><a href="http://www.edmerritt.com/">Ed Merritt<img class="alignnone size-full wp-image-451"  src="http://zomigi.com/wp-content/uploads/2010/12/mediaqueries_edmerritt.png" alt="" width="500" height="222" /></a></li>
<li><a href="http://www.tenbytwenty.com/">Ten by twenty</a></li>
<li><a href="http://www.informationarchitects.jp/en/">iA</a></li>
<li><a href="http://lessframework.com/">Less Framework</a></li>
</ul>
<p>Know of any other great uses of media queries in the wild? Please share them in the comments!</p>
<h3>Update 1/25/11:</h3>
<p>I&#8217;ve learned about a few other resources for media queries/responsive layout inspiration:</p>
<ul>
<li><a href="http://mediaqueri.es/">Media Queries gallery</a></li>
<li><a href="http://www.mayfielddigital.co.uk/blog/web-round-up/best-responsive-web-design-examples-and-resources/">Web round up #11: The best responsive web design examples and resources</a></li>
<li><a href="http://www.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/">Responsive Web Design: What It Is and How To Use It</a></li>
</ul>
<p>Also, I&#8217;m bookmarking sites that I find to be nice examples of media queries on <a href="http://www.delicious.com/pixelsurge/mediaqueries+nicedesign">Delicious</a>.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://zomigi.com/blog/media-queries-presentation/' title='Media queries presentation at indieconf'>Media queries presentation at indieconf</a></li>
<li><a href='http://zomigi.com/blog/essential-considerations-for-crafting-quality-media-queries/' title='Essential considerations for crafting quality media queries'>Essential considerations for crafting quality media queries</a></li>
<li><a href='http://zomigi.com/blog/theres-already-a-book-on-responsive-web-design-want-to-win-it/' title='There&#8217;s already a book on responsive web design. Want to win it?'>There&#8217;s already a book on responsive web design. Want to win it?</a></li>
<li><a href='http://zomigi.com/blog/the-liquid-web-site-motherload/' title='The liquid web site motherload'>The liquid web site motherload</a></li>
<li><a href='http://zomigi.com/blog/why-browser-zoom-shouldnt-kill-flexible-layouts/' title='Why browser zoom shouldn&#8217;t kill flexible layouts'>Why browser zoom shouldn&#8217;t kill flexible layouts</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zomigi.com/blog/examples-of-flexible-layouts-with-css3-media-queries/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>70+ essential resources for creating liquid and elastic layouts</title>
		<link>http://zomigi.com/blog/essential-resources-for-creating-liquid-and-elastic-layouts/</link>
		<comments>http://zomigi.com/blog/essential-resources-for-creating-liquid-and-elastic-layouts/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 20:05:57 +0000</pubDate>
		<dc:creator>Zoe Gillenwater</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[elastic]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[Flexible Web Design]]></category>
		<category><![CDATA[liquid]]></category>
		<category><![CDATA[responsive web design]]></category>

		<guid isPermaLink="false">http://zomigi.com/?p=270</guid>
		<description><![CDATA[Check out these great online resources on creating liquid/fluid and elastic layouts, including sources for design inspiration, downloadable templates, frameworks, articles and tutorials.]]></description>
			<content:encoded><![CDATA[<p>I often get asked for my recommendations of resources to learn how to create liquid/fluid and elastic layouts. My first answer is, of course, my own book <a href="http://zomigi.com/publications/#pub-fwd"><em>Flexible Web Design: Creating Liquid and Elastic Layouts with CSS</em></a>. Hey, is it so bad to be proud of your work? It&#8217;s the only book out there entirely devoted to designing and building flexible web sites, and the dozens of layout techniques it covers can also be applied to fixed-width design. But I&#8217;ll shut up about my book now; if you&#8217;re not the book-buying type, here are over 70 online resources to get you started creating attractive and robust flexible web pages.</p>
<h2>Design inspiration</h2>
<p>It&#8217;s always helpful to look at existing liquid and elastic sites to get inspiration for how to design your own. I&#8217;ve pulled together several sources of flexible design inspiration in a couple former blog posts on my site:</p>
<ul>
<li><a href="http://zomigi.com/blog/inspiration-for-flexible-web-design/">Inspiration for flexible web design</a></li>
<li><a href="http://zomigi.com/blog/the-liquid-web-site-motherload/">The liquid web site motherload</a></li>
</ul>
<h2>Templates</h2>
<p>Even if you don&#8217;t read my book, you can <a href="http://www.flexiblewebbook.com/files.html">download the example and exercise files</a> from the book&#8217;s companion site. They essentially give you several <a href="http://www.flexiblewebbook.com/files.html">liquid and elastic layout templates or starter pages</a> that you can use to build your own liquid and elastic sites.</p>
<p>Here are some other layout templates:</p>
<ul>
<li>Matthew James Taylor&#8217;s <a href="http://matthewjamestaylor.com/blog/perfect-multi-column-liquid-layouts">liquid</a> and <a href="http://matthewjamestaylor.com/blog/ultimate-multi-column-liquid-layouts-em-and-pixel-widths">elastic layouts</a></li>
<li><a href="http://blog.html.it/layoutgala/">Layout Gala liquid layouts</a></li>
<li><a href="http://layouts.ironmyers.com/100_percent_Layouts/">IronMyers liquid layouts</a></li>
<li><a href="http://css-tricks.com/downloads/layouts-templates/">CSS-Tricks liquid layouts</a> (see &#8220;Layout Packs&#8221; third on page)</li>
<li><a href="http://www.dynamicdrive.com/style/layouts/category/C13/">Dynamic Drive CSS liquid layouts</a></li>
<li><a href="http://themeforest.net/browse/attributes/layout/liquid">ThemeForest&#8217;s liquid fully-designed templates</a></li>
<li><a href="http://wordpress.org/extend/themes/tags/flexible-width">WordPress flexible themes</a></li>
</ul>
<p><span id="more-270"></span>Here are some frameworks and grid systems that allow you to make liquid and/or elastic layouts:</p>
<ul>
<li><a href="http://www.fluidgrid.net/">Fluid Grid framework</a></li>
<li><a href="http://fluid.newgoldleaf.com/">Fluid Grid System framework</a></li>
<li><a href="http://designinfluences.com/fluid960gs/">Fluid 960 Grid System</a></li>
<li><a href="http://aplus.rs/css/em-based-typographic-grid/">aplus elastic grid</a></li>
<li><a href="http://elasticss.com/">Elastic framework</a> (elastic and liquid)</li>
<li><a href="http://code.google.com/p/emastic/">Emastic framework</a> (elastic and liquid)</li>
<li><a href="http://developer.yahoo.com/yui/grids/">YUI Grids CSS</a> (liquid)</li>
<li><a href="http://www.yaml.de/en/home.html">YAML framework</a> (elastic and liquid)</li>
<li><a href="http://www.1kbgrid.com/">The 1kb CSS Grid</a> can be adapted for liquid layouts (see description halfway through <a href="http://www.usabilitypost.com/2009/06/19/the-1kb-css-grid-part-3/">this article</a>)</li>
</ul>
<h2>Articles</h2>
<p>Here are some general articles on the what and why of flexible layouts:</p>
<ul>
<li><a href="http://www.flexiblewebbook.com/downloads/FlexibleWebDesign_sample_ch1.pdf">Sample of Chapter 1: Understanding Flexible Layouts</a> (PDF, from Flexible Web Design book)</li>
<li><a href="http://www.smashingmagazine.com/2009/06/02/fixed-vs-fluid-vs-elastic-layout-whats-the-right-one-for-you/">Fixed vs. Fluid vs. Elastic Layout: What’s The Right One For You?</a> (Smashing Magazine)</li>
<li><a href="http://green-beast.com/blog/?p=199">CSS Layouts: The Fixed. The Fluid. The Elastic.</a> (Beast-Blog.com)</li>
<li><a href="../blog/why-browser-zoom-shouldnt-kill-flexible-layouts/">Why browser zoom shouldn’t kill flexible layouts</a></li>
<li><a  rel="bookmark" href="http://alastairc.ac/2007/01/elastic-layout-wrong-term/">Elastic layout – wrong term?</a> (AlastairC)</li>
<li><a href="http://alastairc.ac/2006/05/accessible-layouts/">Accessible layouts</a> (AlastairC)</li>
<li><a href="http://www.sitepoint.com/blogs/2009/04/17/flexible-designs-dying-out/">Where Have All the Flexible Designs Gone?</a> (Sitepoint)</li>
<li><a href="http://www.smashingmagazine.com/2008/06/26/flexible-layouts-challenge-for-the-future/">Flexible Layouts: Challenge For The Future</a> (Smashing Magazine)</li>
<li><a href="http://www.alistapart.com/articles/elastic/">Elastic Design</a> (A List Apart)</li>
<li><a href="http://adactio.com/journal/1156">Fixtorati</a> (Adactio)</li>
<li><a href="http://www.maxdesign.com.au/presentation/liquid-layouts/index.htm">Liquid layouts using CSS &#8211; the joy, the pain, the tears</a> (presentation at Web Essentials 05)</li>
</ul>
<p>Understanding min-width and max-width is essential to working with flexible layouts:</p>
<ul>
<li>Sitepoint&#8217;s CSS reference on <a href="http://reference.sitepoint.com/css/min-width">min-width</a> and <a href="http://reference.sitepoint.com/css/max-width">max-width</a></li>
<li><a href="http://www.flexiblewebbook.com/downloads/FlexibleWebDesign_MinMaxIE.pdf">Add min-width and max-width Support in Internet Explorer 6</a> (PDF, from Flexible Web Design book)</li>
</ul>
<p>Understanding line lengths is also essential. Although popular belief is that there&#8217;s a narrow band of line lengths that are ideal for everyone&#8217;s reading comfort, the (limited) research that&#8217;s been done on on-screen reading suggests that there is a much larger range of effective line lengths, and that there is a difference between preference and efficacy. Age, disability, reading level, native language, leading, and other factors can all impact which line lengths are most effective for specific individuals in specific situations. See these articles for details:</p>
<ul>
<li><a href="http://www.viget.com/advance/the-line-length-misconception/">The Line Length Misconception</a> (Viget Advance)</li>
<li><a href="http://www.usability.gov/pubs/082006news.html">Reading Onscreen: The Effects of Line Length on Performance</a> (usability.gov)</li>
<li><a href="http://www.surl.org/usabilitynews/72/LineLength.asp">The Effects of Line Length on Reading Online News</a> (SURL Usability News)</li>
<li><a href="http://www.surl.org/usabilitynews/42/text_length.asp">The Effects of Line Length on Children and Adults&#8217; Online Reading Performance</a> (SURL Usability News)</li>
<li><a href="http://webusability.com/article_line_length_12_2002.htm">Optimal Line Length: Research Supporting How Line Length Affects Usability</a> (webusability.com)</li>
<li><a href="http://www.humanfactors.com/downloads/feb03.asp">Reading Text Online</a> (UI Design Newsletter)</li>
<li><a href="http://cssing.blogspot.com/2004/08/line-length-is-not-different-than-any.html">Line-length is not different than any other user preference</a> (CSSing)</li>
</ul>
<h2>Tutorials</h2>
<p>Here are tutorials on creating multiple-column liquid and elastic layouts:</p>
<ul>
<li><a href="http://www.maxdesign.com.au/presentation/liquid/index.htm">Liquid layouts the easy way</a> (Max Design)</li>
<li><a href="http://www.webreference.com/authoring/style/sheets/css_mastery2/">CSS Mastery: Fixed-Width, Liquid, and Elastic Layouts and Faux Columns</a> (excerpt from CSS Mastery on webreference.com)</li>
<li><a href="http://www.456bereastreet.com/archive/200504/fixed_or_fluid_width_elastic/">Fixed or fluid width? Elastic!</a> (456 Berea Street)</li>
<li><a href="http://www.communitymx.com/abstract.cfm?cid=DB750">Creating Elastic Layouts with the em Unit</a> (Community MX)</li>
<li><a href="http://jontangerine.com/log/2007/09/the-incredible-em-and-elastic-layouts-with-css">The Incredible Em &amp; Elastic Layouts with CSS</a> (Jon Tan)</li>
<li><a href="http://www.alistapart.com/articles/fluidgrids/">Fluid Grids</a> (A List Apart)</li>
<li><a href="http://www.markboulton.co.uk/journal/comments/five-simple-steps-to-designing-grid-systems-part-5">Five simple steps to designing grid systems — Part 5</a> (on liquid grids, by Mark Boulton)</li>
<li><a href="http://christopherschmitt.com/2007/10/23/css-floats-to-display-columns-in-any-order/">CSS Floats to Display Columns in Any Order</a> (Christopher Schmitt)</li>
<li><a href="http://forabeautifulweb.com/blog/about/changingman_layout_updated">Changingman layout (updated)</a> (also a template, from For a Beautiful Web)</li>
<li><a href="http://24ways.org/2006/intricate-fluid-layouts">Intricate Fluid Layouts in Three Easy Steps</a> (24 Ways)</li>
<li><a href="http://www.alistapart.com/articles/holygrail/">In Search of the Holy Grail</a> (A List Apart)</li>
<li><a href="http://www.alistapart.com/articles/negativemargins/">Creating Liquid Layouts with Negative Margins</a> (A List Apart)</li>
<li><a href="http://www.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/">The Definitive Guide to Using Negative Margins</a> (Smashing Magazine)</li>
<li><a href="http://www.mindfly.com/blog/post/2009/01/12/Get-Refreshed-Liquid-Layouts-With-Simpler-CSS-and-Without-A-Semantic-Mess.aspx">Get Refreshed: Liquid Layouts With Simpler CSS and Without A Semantic Mess</a> (Mindfly)</li>
<li><a href="http://www.alistapart.com/articles/multicolumnlayouts/">Multi-Column Layouts Climb Out of the Box</a> (A List Apart)</li>
<li><a href="http://boagworld.com/design/fluid-elastic-design"><span style="position: relative;">Fluid elastic design</span></a> (Boagworld)</li>
<li><a href="http://www.peachpit.com/articles/article.aspx?p=1322358">Using the Liquid CSS Layouts in Dreamweaver CS4</a> (excerpt from Mastering CSS with Dreamweaver CS4 on peachpit.com)</li>
<li><a href="http://www.socialgeek.be/blog/read/flexible-equal-height-columns">Flexible equal height columns</a> (SocialGeek)</li>
<li><a href="http://valums.com/vertical/">Vertical Centering with CSS</a> (Andrew Valums)</li>
</ul>
<p>Creating successful flexible pages is about more than just the layout; you have to make sure the content inside the layout can be flexible too. Here are tutorials on making content, backgrounds, and other effects work with flexible layouts:</p>
<ul>
<li><a href="http://www.communitymx.com/abstract.cfm?cid=AFC58">Creating Liquid Faux Columns</a> (Community MX)</li>
<li><a href="http://nickcowie.com/2005/elastic-faux-columns/">Elastic Faux Columns</a> (Nick Cowie)</li>
<li><a href="http://www.sohtanaka.com/web-design/smart-columns-w-css-jquery/">Smart Columns w/ CSS &amp; jQuery</a> (Soh Tanaka)</li>
<li><a href="http://css-tricks.com/equidistant-objects-with-css/">Equidistant Objects with CSS</a> (CSS-Tricks)</li>
<li><a href="http://www.flexiblewebbook.com/downloads/FlexibleWebDesign_sample_ch9.pdf">Sample of Chapter 9: Creating Flexible Images</a> (PDF, from Flexible Web Design book)</li>
<li><a href="../blog/foreground-images-that-scale-with-the-layout/">Foreground images that scale with the layout</a> (pure CSS solution)</li>
<li><a href="http://buildinternet.com/2009/07/quick-tip-resizing-images-based-on-browser-window-size/">Quick Tip – Resizing Images Based On Browser Window Size</a> (JavaScript solution, from Build Internet!)</li>
<li><a href="../blog/creating-sliding-composite-images/">Creating sliding composite images</a></li>
<li><a href="../blog/css-effect-space-images-out-to-match-text-height/">CSS effect: space images out to match text height</a></li>
<li><a href="../blog/hiding-and-revealing-portions-of-images/">Hiding and revealing portions of images</a></li>
<li><a href="http://www.sitepoint.com/blogs/2007/12/20/stretchy-images-with-html-and-css/">Stretchy Images with HTML and CSS</a> (Sitepoint)</li>
<li><a href="http://friedcellcollective.net/outbreak/2009/10/04/fluid-searchbox/">Fluid searchbox</a> (outbreak)</li>
</ul>
<p>This should keep you busy for a while, no? I hope this will be the start of some lovely liquid and elastic designs for you, folks! Drop me a line if you have one you want to show off; I love seeing other people&#8217;s great work.</p>
<p class="note"><a href="http://digg.com/design/70_essential_resources_for_creating_liquid_elastic_layouts">Digg</a> this article if you enjoyed it. Thanks!</p>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://zomigi.com/blog/hiding-and-revealing-portions-of-images/' title='Hiding and revealing portions of images'>Hiding and revealing portions of images</a></li>
<li><a href='http://zomigi.com/blog/foreground-images-that-scale-with-the-layout/' title='Foreground images that scale with the layout'>Foreground images that scale with the layout</a></li>
<li><a href='http://zomigi.com/blog/media-queries-presentation/' title='Media queries presentation at indieconf'>Media queries presentation at indieconf</a></li>
<li><a href='http://zomigi.com/blog/why-browser-zoom-shouldnt-kill-flexible-layouts/' title='Why browser zoom shouldn&#8217;t kill flexible layouts'>Why browser zoom shouldn&#8217;t kill flexible layouts</a></li>
<li><a href='http://zomigi.com/blog/creating-sliding-composite-images/' title='Creating sliding composite images'>Creating sliding composite images</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zomigi.com/blog/essential-resources-for-creating-liquid-and-elastic-layouts/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>Me at The CSS Summit online conference</title>
		<link>http://zomigi.com/blog/css-summit/</link>
		<comments>http://zomigi.com/blog/css-summit/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 19:30:35 +0000</pubDate>
		<dc:creator>Zoe Gillenwater</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[elastic]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[liquid]]></category>
		<category><![CDATA[speaking]]></category>
		<category><![CDATA[visual design]]></category>

		<guid isPermaLink="false">http://zomigi.com/?p=216</guid>
		<description><![CDATA[Download the slides from my presentation at The CSS Summit online conference, as well as get links to related tutorials on designing flexible images.]]></description>
			<content:encoded><![CDATA[<p>I just gave my talk Designing CSS Layouts for the Flexible Web from my own little basement office for <a href="http://environmentsforhumans.com/">The CSS Summit online conference</a>. Yes, yes, I&#8217;ve given this presentation before, but of course I had to do a little bit of updating and improving, especially because this is the first time I gave it online instead of with a live audience. So, here are the new and improved slides for your downloading pleasure:</p>
<p><a href="http://www.zomigi.com/downloads/Designing-CSS-Layouts-Flexible-Web_Summit.pdf">Designing CSS Layouts for the Flexible Web (PDF, 5.5 mb)</a></p>
<p>Yes, it’s a big file—there are a lot of graphics in the PowerPoint. But I didn’t want to compress it very much and have all those graphics look distorted, since examining the graphics is the main point of the presentation.</p>
<p>There&#8217;s a little CSS in the presentation, but if you want more in-depth tutorials on the techniques alluded to in the presentation, I’ve written up many of them on this blog:</p>
<ul>
<li><a href="../blog/foreground-images-that-scale-with-the-layout/">Foreground images that scale with the layout</a></li>
<li><a href="../blog/hiding-and-revealing-portions-of-images/">Hiding and revealing portions of images</a></li>
<li><a href="../blog/creating-sliding-composite-images/">Creating sliding composite images</a></li>
<li><a href="http://zomigi.com/blog/css-effect-space-images-out-to-match-text-height/">Space images out to match text height</a></li>
</ul>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://zomigi.com/blog/vtm-web-design-conference-2009/' title='Voices That Matter: Web Design Conference 2009'>Voices That Matter: Web Design Conference 2009</a></li>
<li><a href='http://zomigi.com/blog/revised-presentation-slides-available/' title='Revised presentation slides available'>Revised presentation slides available</a></li>
<li><a href='http://zomigi.com/blog/voices-that-matter-slides-available/' title='Voices That Matter slides available'>Voices That Matter slides available</a></li>
<li><a href='http://zomigi.com/blog/media-queries-presentation/' title='Media queries presentation at indieconf'>Media queries presentation at indieconf</a></li>
<li><a href='http://zomigi.com/blog/hiding-and-revealing-portions-of-images/' title='Hiding and revealing portions of images'>Hiding and revealing portions of images</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zomigi.com/blog/css-summit/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The liquid web site motherload</title>
		<link>http://zomigi.com/blog/the-liquid-web-site-motherload/</link>
		<comments>http://zomigi.com/blog/the-liquid-web-site-motherload/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 20:03:13 +0000</pubDate>
		<dc:creator>Zoe Gillenwater</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[liquid]]></category>
		<category><![CDATA[responsive web design]]></category>
		<category><![CDATA[visual design]]></category>

		<guid isPermaLink="false">http://zomigi.com/?p=192</guid>
		<description><![CDATA[Check out Nomensa's portfolio for great examples of liquid site designs.]]></description>
			<content:encoded><![CDATA[<p>I feel like a kid in a candy store. A nerdy kid. Because I&#8217;ve hit the liquid web site motherload: <a href="http://www.nomensa.com/client-portfolio.html">Nomensa&#8217;s portfolio</a>.</p>
<p><a href="http://www.nomensa.com/">Nomensa</a> is a web agency specializing in accessibility and usability. Their own site is a nice example of a liquid design, and I&#8217;ve had it bookmarked for a while, but I finally got a chance to check out the sites in their portfolio. There are dozens and dozens of them, and almost all of them are liquid. (They also have a few elastic ones, and a few fixed-width.) Unfortunately, Nomensa doesn&#8217;t provide links to all of their work, but only a select few as case studies. But, you can google the names of the non-case-study clients, and you&#8217;ll find that most of these sites are liquid as well.</p>
<p>Now, I grant you, many of the sites are not terribly stylish. But they still are really useful to look at to get ideas for how to handle content and layout in liquid layouts. You could easily use the same techniques they&#8217;re using with a bit more spit and polish added.</p>
<p><span id="more-192"></span></p>
<p>Here are a few of the most well done liquid sites from Nomensa&#8217;s portfolio:</p>
<dl>
<dt><a href="http://www.barchamonline.co.uk/">Barcham Online</a></dt>
<dd>The header using seven images of tree foliage that expand and contract to fill the available space is very clever and attractive. Also check out the feature boxes on the home page and the thumbnail gallery under Our Trees. It&#8217;s notable that this is an e-commerce site, which you don&#8217;t often see liquid.</dd>
<dt><a href="http://www.broads-authority.gov.uk/">Broads Authority</a></dt>
<dd>I&#8217;m not in love with the overall look and feel of this site, but I appreciate the unique layout of the home page. The main image on the home page that has a text box below, which moves down as the text in the adjacent columns grows, revealing more of the image above, is very well done.</dd>
<dt><a href="http://www.preston.gov.uk/">Preston City Council</a></dt>
<dd>Another unique home page layout and neat use of &#8220;variable cropping&#8221; on the main photo. Be sure to check out the Gallery under Get Involved, as well as all the little feature boxes and things on the inner pages.</dd>
<dt><a href="http://www.macmillan.org.uk/">Macmillan Cancer Support</a></dt>
<dd>This site is notable for the large amount of information that it organizes into liquid rounded corner boxes throughout the site, without everything becoming chaotic and unbalanced at different viewport widths.</dd>
<dt><a href="http://www.startupcommunity.co.uk/">Business Startup Community</a></dt>
<dd>Again, not a very attractive site, but I&#8217;m bookmarking it simply for the treatment of the three tabs on the <a href="http://www.startupcommunity.co.uk/starting-a-business/">inner</a> sections of the site.</dd>
</dl>
<p>I&#8217;ll be sure to stop by Nomensa&#8217;s portfolio periodically to see what new work they are featuring and gather ideas for solving problems in my own work. I should have mentioned in my <a href="http://zomigi.com/blog/inspiration-for-flexible-web-design/">flexible web design inspiration post</a> that a great place to find liquid and elastic sites is within the portfolios of agencies or designers who themselves have liquid or elastic sites. Nomensa is now on this list for me.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://zomigi.com/blog/updated-flexible-design-inspiration/' title='Updated flexible design inspiration'>Updated flexible design inspiration</a></li>
<li><a href='http://zomigi.com/blog/inspiration-for-flexible-web-design/' title='Inspiration for flexible web design'>Inspiration for flexible web design</a></li>
<li><a href='http://zomigi.com/blog/media-queries-presentation/' title='Media queries presentation at indieconf'>Media queries presentation at indieconf</a></li>
<li><a href='http://zomigi.com/blog/why-browser-zoom-shouldnt-kill-flexible-layouts/' title='Why browser zoom shouldn&#8217;t kill flexible layouts'>Why browser zoom shouldn&#8217;t kill flexible layouts</a></li>
<li><a href='http://zomigi.com/blog/vtm-web-design-conference-2009/' title='Voices That Matter: Web Design Conference 2009'>Voices That Matter: Web Design Conference 2009</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zomigi.com/blog/the-liquid-web-site-motherload/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Why browser zoom shouldn&#8217;t kill flexible layouts</title>
		<link>http://zomigi.com/blog/why-browser-zoom-shouldnt-kill-flexible-layouts/</link>
		<comments>http://zomigi.com/blog/why-browser-zoom-shouldnt-kill-flexible-layouts/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 14:24:38 +0000</pubDate>
		<dc:creator>Zoe Gillenwater</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[elastic]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[liquid]]></category>
		<category><![CDATA[responsive web design]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://zomigi.com/?p=56</guid>
		<description><![CDATA[All the major browsers now have zoom functions built in, which may make it seem like there's no longer any need for liquid or elastic layouts. Not so.]]></description>
			<content:encoded><![CDATA[<p>Now that all the major browsers  include the ability to zoom the entire page layout, rather than just increase text size, are liquid and elastic layouts obsolete? Can&#8217;t we just use fixed-width layouts and let the user zoom them if needed? The answer to that question depends on whether browser zoom solves all of the same problems than liquid and elastic layouts solve, and I don&#8217;t think it does.</p>
<p>Don&#8217;t get me wrong—it&#8217;s great that browsers have added this zoom ability. It&#8217;s yet another tool to give users more control to view web pages in a way that is most easy and enjoyable for them. But liquid and elastic layouts still offer a lot of benefits, as does plain old text resizing. Let&#8217;s go through the flexible layout benefits one by one and see if browser zooming on fixed-width layouts can deliver just as well.<br />
<span id="more-56"></span></p>
<h3>Prevent horizontal scrolling</h3>
<p>Liquid layouts get rid of the dreaded horizontal scrollbar (or <a href="http://adactio.com/journal/1559/">crawlbar</a>, as Jeremy Keith would have us say) for most users, since the layout adapts to whatever viewport size they&#8217;re currently using. This is a great boost to readability and overall usability. Browser zooming doesn&#8217;t do this automatically, and though it can be used to get rid of the horizontal scrollbar once it&#8217;s shown up, it produces unwanted side effects in the process.</p>
<p>Here&#8217;s an example from my own experience to illustrate what I mean. I usually keep my browser window at about 900 pixels wide, simply because that&#8217;s a width I find comfortable to read and visually pleasing, and because it fits well with the other windows I have open in my widescreen monitor. Browsing at 900 pixels means that most sites designed for a 1024 resolution produce a horizontal scrollbar for me. Now, I can zoom out of the page in order to make the whole layout smaller and make it fit in my window. But when I do this, the text size of the page gets smaller, since everything is smaller when you use browser zoom. Now I can&#8217;t read the page. All I wanted was the page to fit in my viewport, not for the text to change size. Liquid layouts are perfectly suited to this task, and browser zoom is not.</p>
<h3>Take advantage of screen real estate</h3>
<p>Liquid layouts allow you to make full use of the area available in the viewport, showing more or less content, depending on what will fit at any given moment. Browser zoom doesn&#8217;t do this. You can zoom in to fill up the viewport, but again, this just makes everything bigger, instead of showing more content to the user who has the space for it.</p>
<h3>Allow users to choose their own line lengths</h3>
<p>Liquid layouts essentially allow users to choose the line length, or number of text characters per line of text, that is most comfortable for them to read. Although most people will find the same, optimal line length easily readable (75 to 100 characters seems to be best for most people for on-screen reading), there are certain people who favor long or short lines of text, and those people who <em>do</em> make a conscious choice about their line lengths deserve to have this preference respected.</p>
<p>Browser zooming with fixed-width layouts doesn&#8217;t give users this ability to adjust the line length to fit their needs. Instead, the line length is fixed at a particular value that varies only based on the user&#8217;s text size. Users with large default text sizes may get much shorter line lengths than they prefer, for instance, and changing the zoom level will only preserve these un-ideal line lengths for them.</p>
<h3>Set an optimal line length</h3>
<p>Elastic layouts also don&#8217;t give users the ability to change the line length to suit their needs, but they do give the designer the ability to choose a line length that will be ideal for the majority of users. You might think you can do this with a fixed-width layout as well—and you could, if all your users had the same text size. If everyone kept the 16-pixel default text size, you could make your layout a fixed number of pixels and know exactly how many text characters would fit across each line. Then, if the users needed to zoom in to make the text bigger and easier for them to read, this same, optimal line length would be preserved, just with larger text characters.</p>
<p>But it doesn&#8217;t work this way in the real world. Not everyone uses the default text size. Some people make it bigger due to vision problems or other disabilities. Some people make it bigger because they have such a huge resolution on their huge monitor. Some people simply have the dpi on their machines set to 120 instead of 96, which makes all text throughout their system bigger. All of these users are going to have a different line length than the one you intended in your fixed-width layout. This won&#8217;t happen in an elastic layout, because its width will always be based on the user&#8217;s default or current text size, keeping line lengths constant.</p>
<p>But it doesn&#8217;t work this way in the real world. Not everyone uses the default text size, and those that don&#8217;t are going to have a different line length than the one you intended in your fixed-width layout. This won&#8217;t happen in an elastic layout, because its width will always be based on the user&#8217;s default or current text size, keeping line lengths constant.</p>
<h3>Preserve design proportions</h3>
<p>Elastic layouts give you more control over where text falls in relation to other design components on the page. No matter the text size, your design remains proportional and visually consistent (depending on if you choose to make the images scale too, of course). Again, you might think you can accomplish this with fixed-width layouts and browser zoom, but variable user text sizes make it impossible to know where a piece of text is going to fall on a fixed-width page.</p>
<h3>Make text more readable</h3>
<p>All of the  benefits of liquid and elastic layouts that I&#8217;ve gone over have to do with respecting user preferences and  making text easier to read. It seems to me that this is the goal of browser zoom as well, and in many cases it does make text easier for the user to read. But browser zoom also scales images. In some cases, this is probably desirable, as the user may want to get a better look at an image as well as the text. But,  images scaled through zooming are going to be pixellated and blurry, so zooming may not help the user at all. And, I&#8217;m willing to bet that in most cases, users have no need or desire to view your logo or sidebar ad at three times its original size, and that the now-huge images are just getting in their way. (That&#8217;s why I reset Firefox, my default browser, to <a href="http://support.mozilla.com/en-US/kb/Text+Zoom">just scale text instead of zooming</a>.)</p>
<p>If you have images that you think the user will want to get a closer look at, you can choose to scale only these images using easy CSS tricks. You can set up your images and CSS in such a way that the images will have little distortion or blurriness when scaled dynamically by the browser. The other images can all remain a constant size, so that they don&#8217;t get in the way of users with very large text and contribute to horizontal scrollbars, float drops, or other nasty things that can happen when you put huge images into web pages. And of couse, if a user <em>does</em> want to scale one of the non-scalable images, they can always use the browser zoom function as a backup method.</p>
<h3>Conclusion</h3>
<p>Again, I have to stress that  zooming is a great function for browsers to include. Also, fixed-width layouts are not evil—they are ideal in certain situations. But liquid and elastic layouts have a lot of benefits that fixed-width layouts in combination with browser zoom can&#8217;t necessarily match. Luckily, I&#8217;m <a href="http://adactio.com/journal/1576">not the only one</a> who recognizes this. Don&#8217;t use browser zooming as a reason to stop—or never start—making flexible layouts.</p>
<p>If you want more detail on all these benefits of flexible layouts, check out the <a href="http://www.flexiblewebbook.com/bonus.html">free sample of Chapter 1</a> of my book, <a href="http://www.flexiblewebbook.com">Flexible Web Design: Creating Liquid and Elastic Layouts with CSS</a>.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://zomigi.com/blog/updated-flexible-design-inspiration/' title='Updated flexible design inspiration'>Updated flexible design inspiration</a></li>
<li><a href='http://zomigi.com/blog/inspiration-for-flexible-web-design/' title='Inspiration for flexible web design'>Inspiration for flexible web design</a></li>
<li><a href='http://zomigi.com/blog/essential-resources-for-creating-liquid-and-elastic-layouts/' title='70+ essential resources for creating liquid and elastic layouts'>70+ essential resources for creating liquid and elastic layouts</a></li>
<li><a href='http://zomigi.com/blog/the-liquid-web-site-motherload/' title='The liquid web site motherload'>The liquid web site motherload</a></li>
<li><a href='http://zomigi.com/blog/vtm-web-design-conference-2009/' title='Voices That Matter: Web Design Conference 2009'>Voices That Matter: Web Design Conference 2009</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zomigi.com/blog/why-browser-zoom-shouldnt-kill-flexible-layouts/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>Voices That Matter: Web Design Conference 2009</title>
		<link>http://zomigi.com/blog/vtm-web-design-conference-2009/</link>
		<comments>http://zomigi.com/blog/vtm-web-design-conference-2009/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 20:00:23 +0000</pubDate>
		<dc:creator>Zoe Gillenwater</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[elastic]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[liquid]]></category>
		<category><![CDATA[speaking]]></category>
		<category><![CDATA[visual design]]></category>

		<guid isPermaLink="false">http://zomigi.com/?p=83</guid>
		<description><![CDATA[Download the slides from my presentation at Voices That Matter: Web Design Conference 2009, as well as get links to related tutorials on designing flexible images.]]></description>
			<content:encoded><![CDATA[<p>I just gave my talk Designing CSS Layouts for the Flexible Web here in San Francisco for the Voices That Matter: Web Design Conference. I was asked to give the same presentation I gave <a href="http://zomigi.com/blog/voices-that-matter-slides-available/">last year</a>, but of course I had to do a little bit of updating and improving. So, here are the new and improved slides for your downloading pleasure:</p>
<p><a href="../downloads/Designing-CSS-Layouts-Flexible-Web_090428.pdf">Designing CSS Layouts for the Flexible Web (PDF, 5 mb)</a></p>
<p>Yes, it&#8217;s a big file—there are a lot of graphics in the PowerPoint. But I didn’t want to compress it very much and have all those graphics look distorted, since examining the graphics is the main point of the presentation.</p>
<p>If you&#8217;re ready to get beyond the graphics and start working on the actual CSS techniques alluded to in the presentation, I&#8217;ve written up many of them on this blog:</p>
<ul>
<li><a href="http://zomigi.com/blog/foreground-images-that-scale-with-the-layout/">Foreground images that scale with the layout</a></li>
<li><a href="http://zomigi.com/blog/hiding-and-revealing-portions-of-images/">Hiding and revealing portions of images</a></li>
<li><a href="http://zomigi.com/blog/creating-sliding-composite-images/">Creating sliding composite images<br />
</a></li>
</ul>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://zomigi.com/blog/css-summit/' title='Me at The CSS Summit online conference'>Me at The CSS Summit online conference</a></li>
<li><a href='http://zomigi.com/blog/revised-presentation-slides-available/' title='Revised presentation slides available'>Revised presentation slides available</a></li>
<li><a href='http://zomigi.com/blog/voices-that-matter-slides-available/' title='Voices That Matter slides available'>Voices That Matter slides available</a></li>
<li><a href='http://zomigi.com/blog/updated-flexible-design-inspiration/' title='Updated flexible design inspiration'>Updated flexible design inspiration</a></li>
<li><a href='http://zomigi.com/blog/inspiration-for-flexible-web-design/' title='Inspiration for flexible web design'>Inspiration for flexible web design</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zomigi.com/blog/vtm-web-design-conference-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating sliding composite images</title>
		<link>http://zomigi.com/blog/creating-sliding-composite-images/</link>
		<comments>http://zomigi.com/blog/creating-sliding-composite-images/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 18:00:45 +0000</pubDate>
		<dc:creator>Zoe Gillenwater</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[Flexible Web Design]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[liquid]]></category>
		<category><![CDATA[responsive web design]]></category>

		<guid isPermaLink="false">http://zomigi.com/?p=101</guid>
		<description><![CDATA[Create the appearance of a single image by layering multiple images on top of each other. The pieces can slide around the page as its width is changed, making it a perfect technique for liquid layouts.]]></description>
			<content:encoded><![CDATA[<p class="note">This tutorial is slightly adapted from Chapter 9 of my book, <a href="http://www.amazon.com/gp/product/0321553845?ie=UTF8&amp;tag=zoeshomepage&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0321553845"><em>Flexible Web Design: Creating Liquid and Elastic Layouts with CSS</em></a>. You can download most of <a href="http://www.flexiblewebbook.com/bonus.html">Chapter 9</a> for free as a PDF at the <a href="http://www.flexiblewebbook.com">Flexible Web Design companion site</a>, as well as download the <a href="http://www.flexiblewebbook.com/files.html">HTML, CSS and image files</a> that go along with this tutorial.</p>
<p>Since the area available for an image to display within a flexible layout changes on the fly, your images may need to as well. While fixed-width images can work within flexible layouts—as long as they’re not too large, or you have matching minimum widths in place—there are lots of ways you can dynamically change the screen area that an image takes up.</p>
<p>I&#8217;ve already written about <a href="http://zomigi.com/blog/foreground-images-that-scale-with-the-layout/">how to make images literally scale</a> and <a href="http://zomigi.com/blog/hiding-and-revealing-portions-of-images/">how to use variable cropping on images</a>. But perhaps you don’t want either end of your image dynamically cropped off—there may be important content on each side that you want to always keep in view. And perhaps you don&#8217;t want to scale the entire image, because although this would keep the entire width of the image always visible, it would also change the vertical space the image takes up, which might not work for your design. This is the perfect time to try using what I call a composite image.<br />
<span id="more-101"></span><br />
Creating what appears to be a single image out of multiple pieces that slide over and away from each other takes a little more work on the graphics side than the variable width image techniques we’ve gone over so far. You can use an unlimited number of images, but we’ll keep it simple and use two for our own alieninvasion example as well.</p>
<p>One image is going to be at least partially overlapping the other, so at least the topmost image needs to have a transparent background. (You may choose to make the lower image transparent too, to allow parts of the main page background to show through, for instance.) You can use either a GIF with index transparency or a PNG with alpha transparency. PNGs are more versatile, since they can lay over any other color or pattern without the skinny colored edge that shows around GIF images when they’re placed over something that’s a different color than they were optimized for. PNGs can also have variable degrees of transparency, instead of each pixel being either 100 percent transparent or 100 percent opaque.</p>
<p>We’ll use an alpha-transparent PNG of a flying saucer for our top image in this example. The flying saucer will be laid on top of a photo of the Chicago skyline, saved as an ordinary JPG.</p>
<p>Once you have your images made, you need two block elements to place each on as a background image. One block element needs to be nested inside the other. In a real page, you’d want to make use of block elements that were already in place as much as possible, such as existing wrapper and header divs. For this simple example, we’ll use two empty divs:</p>
<pre><code>&lt;div id="outer"&gt;&lt;div id="inner"&gt;&lt;/div&gt;&lt;/div&gt;</code></pre>
<p>Next, you need to create rules placing each image as a non-repeating background on each div, with the image you want on the bottom used for the background of the outer div:</p>
<pre><code>#outer {
	background: url(skyline.jpg) no-repeat;
	}
#inner {
	background: url(ufo.png) no-repeat;
}</code></pre>
<p>Since the divs are empty, they also need dimensions added to them to stop them from collapsing entirely, as well as to create the flexible behavior that we want:</p>
<pre><code>#outer {
	<em>width: 100%;</em>
	<em>max-width: 1000px; </em>
	<em>height: 300px;</em>
	background: url(skyline.jpg) no-repeat;
	}
#inner {
	<em>width: 100px;</em>
	<em>height: 250px; </em>
	background: url(ufo.png) no-repeat;
	}</code></pre>
<p>Both of the images now show on the page, with the <a href="http://www.zomigi.com/demo/composite_static.html">flying saucer layered over the skyline</a>. However, the flying saucer never moves when the window changes in size—it’s always pinned to the top left corner of the skyline photo. That’s because the div for which it’s a background begins in that corner, and non-repeating, non-positioned background images display in the top left corner by default.</p>
<p class="sidenote">Note: Remember that IE 6 and earlier do not support alpha-transparent PNGs, so the flying saucer image will have a solid gray background in those browsers. Use the alphaimageloader hack described in the exercise section of Chapter 7 to fix this.</p>
<p>There are a couple ways to fix this: use the background-position property to change where the flying saucer displays within the div, or move the entire div. Either option is fine, but the latter seems a little easier to understand and implement—at least to me—so that’s what we’ll use here. We’ll move the div using absolute positioning; floating would work as well. First, add position: relative; to the #outer rule to make that div act as the containing element for the absolutely positioned inner div. Then, add position: absolute; as well as top and right values to the #inner rule:</p>
<pre><code>#inner {
	<em>position: absolute;</em>
	<em>top: 50px; </em>
	<em>right: 50px;</em>
	width: 100px;
	height: 250px;
	background: url(ufo.png) no-repeat;
	}</code></pre>
<p>Now the flying saucer image will always be 50 pixels away from both the top and right edges of the skyline photo. Because the outer div has a flexible width, its right edge moves as the window is resized, which in turn makes the <a href="http://www.zomigi.com/demo/composite.html">flying saucer image move</a> as well.</p>
<p class="note">Update, June 2009: I&#8217;ve written <a href="http://zomigi.com/blog/css-effect-space-images-out-to-match-text-height/">another tutorial on creating composite images</a> that takes a different approach. Thought you might want to check it out too!</p>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://zomigi.com/blog/hiding-and-revealing-portions-of-images/' title='Hiding and revealing portions of images'>Hiding and revealing portions of images</a></li>
<li><a href='http://zomigi.com/blog/foreground-images-that-scale-with-the-layout/' title='Foreground images that scale with the layout'>Foreground images that scale with the layout</a></li>
<li><a href='http://zomigi.com/blog/media-queries-presentation/' title='Media queries presentation at indieconf'>Media queries presentation at indieconf</a></li>
<li><a href='http://zomigi.com/blog/essential-resources-for-creating-liquid-and-elastic-layouts/' title='70+ essential resources for creating liquid and elastic layouts'>70+ essential resources for creating liquid and elastic layouts</a></li>
<li><a href='http://zomigi.com/blog/css-summit/' title='Me at The CSS Summit online conference'>Me at The CSS Summit online conference</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zomigi.com/blog/creating-sliding-composite-images/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Hiding and revealing portions of images</title>
		<link>http://zomigi.com/blog/hiding-and-revealing-portions-of-images/</link>
		<comments>http://zomigi.com/blog/hiding-and-revealing-portions-of-images/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 22:25:32 +0000</pubDate>
		<dc:creator>Zoe Gillenwater</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[elastic]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[Flexible Web Design]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[liquid]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[responsive web design]]></category>

		<guid isPermaLink="false">http://zomigi.com/?p=90</guid>
		<description><![CDATA[It's possible to dynamically "crop" both background and foreground images as the layout changes in width, solving the problem of overflowing fixed-width images in a flexible page.]]></description>
			<content:encoded><![CDATA[<p class="note">This tutorial is slightly adapted from Chapter 9 of my book, <a href="http://www.amazon.com/gp/product/0321553845?ie=UTF8&amp;tag=zoeshomepage&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0321553845"><em>Flexible Web Design: Creating Liquid and Elastic Layouts with CSS</em></a>. You can download most of <a href="http://www.flexiblewebbook.com/bonus.html">Chapter 9</a> for free as a PDF at the <a href="http://www.flexiblewebbook.com">Flexible Web Design companion site</a>, as well as download the <a href="http://www.flexiblewebbook.com/files.html">HTML, CSS and image files</a> that go along with this tutorial.</p>
<p>Since the area available for an image to display within a flexible layout changes on the fly, your images may need to as well. While fixed-width images can work within flexible layouts—as long as they’re not too large, or you have matching minimum widths in place—there are lots of ways you can dynamically change the screen area that an image takes up.</p>
<p>I&#8217;ve already written about <a href="http://zomigi.com/blog/foreground-images-that-scale-with-the-layout/">how to make images literally scale</a>, but another way to change the amount of screen area an image takes up is to dynamically change how much of the image is shown at any given time. The image itself doesn’t change in size—the amount of space in which it’s allowed to show does, and the rest of the image just remains hidden outside of that space. I call this “variable cropping.”</p>
<p>You can create a variable cropping effect with either background or foreground images. Both look the same, but each is specially suited to different situations.<br />
<span id="more-90"></span></p>
<h3>Variable cropping with background images</h3>
<p>Putting the image that you want to dynamically crop in the background is ideal when the image is purely decorative. This technique lets you keep the image in the CSS with the other decorative images, so if you later change the look of the site, all the decorative images can be changed in a single style sheet instead of having to replace multiple <code>img</code> elements across multiple pages of the site. By keeping the decorative image as a CSS background, you’re also making it likely that the image won’t print when the user prints the page—background printing is turned off by default in all major browsers—so the user can save ink by printing only content.</p>
<p>To use a CSS background image, you’ll fi rst need an element on which to place the background. This example will use a <code>div</code>:</p>
<pre><code>&lt;div id="background"&gt;&lt;/div&gt;</code></pre>
<p>The <code>div</code> is completely empty; it contains no content, but exists simply to hold a background image. If you have a more semantic element you can hang the background on instead, use it. For instance, perhaps the image you want to dynamically crop sits above an <code>h3</code> element and matches it in width. You could add the image as a background to the <code>h3</code> element and give the <code>h3</code> enough top padding to make sure its text sits below the image, not on top of it.</p>
<p>Next, create a rule for this <code>div</code> that sets the image as its non-tiling background:</p>
<pre><code>div#background {
	background: url(styx.jpg) no-repeat;
	border: 2px solid #000;
	}</code></pre>
<p>I’ve added a border on to this <code>div</code> as well so you can easily see where its edges lie. Right now, with no content within the <code>div</code>, it will collapse to zero height. Add dimensions to the <code>div</code> to prop it open:</p>
<pre><code>div#background {
	<em>width: 50%; </em>
	<em>height: 330px;</em>
	background: url(styx.jpg) no-repeat;
	border: 2px solid #000;
	}</code></pre>
<p class="tip">Tip: To dynamically change the height of the image as well as or instead of the width, use a flexible value for the <code>height</code> property.</p>
<p>The width is set to some flexible dimension—either a percentage, as I’ve done here, or an em value to make it elastic—so that the <code>div</code> can change in width to show more or less of the image. The height is set to the pixel height of the image so that the entire height of the image will show at all times.</p>
<p>The <code>div</code> will now always be 50 percent as wide as the viewport; its background image doesn’t change in size, but gets <a href="http://www.zomigi.com/demo/crop_background_right.html">cropped to a varying degree from the right side</a>.</p>
<p>However, this particular image would look better cropped from the left side, as the cat’s face is on the right side of the photo. To specify from where the image gets cropped, use the <code>background-position</code> property, or its shorthand in the <code>background</code> property, to change the alignment of the image within the <code>div</code>:</p>
<pre><code>div#background {
	width: 50%;
	height: 330px;
	background: url(styx.jpg) no-repeat <em>right</em>;
	border: 2px solid #000;
	}</code></pre>
<p>The image is now anchored to the right side of the <code>div</code>, so <a href="http://www.zomigi.com/demo/crop_background.html">more or less of its left side shows as the <code>div</code> changes in size</a>.</p>
<p>This is all the CSS necessary to get the basic variable cropping technique working, but you can add a few other enhancements if you like. For instance, right now, once the <code>div</code> exceeds the width of the image, empty white space shows within the <code>div</code>. There are a few ways you could handle this. You could add a background color to the <code>div</code> as well that would fill up whatever space the image cannot; if you blend the edge of the image into this background color, the effect can look seamless. Or, you could add a maximum width to the <code>div</code> so it can never grow larger than the image. You could also add minimum widths, as well as maximum and minimum heights, to ensure that the <code>div</code> can never grow or shrink past particular<br />
points in the image.</p>
<h3>Variable cropping with foreground images</h3>
<p>If the image that you want to dynamically crop is functional content, you’ll want to keep it as a foreground image by placing it in the (X)HTML using the <code>img</code> element. You can ask yourself these questions to determine if the image is content, not decoration:</p>
<ul>
<li>Does the image convey information that I ought to put as text in an <code>alt</code> attribute?</li>
<li>Do I want to make sure the image always prints because without it the<br />
printout wouldn’t make sense or be complete?</li>
<li>Do I want to link the image?</li>
</ul>
<p>If the answer to any of these questions is yes, the image is content and should be kept in the (X)HTML. CSS background images can’t achieve any of these goals—at least not without some complicated workarounds and hacks, all of which are quite silly, considering how easily a simple <code>img</code> element can achieve all this.</p>
<p>As with the background-image version of the variable cropping technique, you’ll need some block element in the (X)HTML to hold the image. We’ll use a <code>div</code> again; this time it won’t be empty, but will instead contain the img element:</p>
<pre><code>&lt;div id="foreground"&gt;
	&lt;img src="styx.jpg" alt="my cat Styx" width="500" height="330"&gt;
&lt;/div&gt;</code></pre>
<p class="sidenote">Note: The <code>img</code> element has an <code>alt</code> attribute providing the text equivalent of the image. You can’t do this with a CSS background image.</p>
<p>Just as before, the <code>div</code> needs to have a flexible width and a height set to the pixel height of the image:</p>
<pre><code>div#foreground {
	width: 50%;
	height: 330px;
	border: 2px solid #000;
	}</code></pre>
<p>So far, all we have is a regular <code>div</code> holding a regular image—there’s nothing yet that makes this a variable cropping technique. If the image is bigger than the <code>div</code>, it doesn’t get cropped, but simply <a href="http://www.zomigi.com/demo/crop_foreground_overflow.html">overflows</a>.</p>
<p>To get the cropping effect, add <code>overflow: hidden;</code> to the CSS rule:</p>
<pre><code>div#foreground {
	<em>overflow: hidden; </em>
	width: 50%;
	height: 330px;
	border: 2px solid #000;
	}</code></pre>
<p>Now whatever portion of the image would overflow out of the <code>div</code> is <a href="http://www.zomigi.com/demo/crop_foreground_right.html">hidden from view</a>.</p>
<p>Once again, though, it would be better for this image to be cropped from the left side, not the right. We can’t use the <code>background-position</code> property this time because it’s not a background image. To change how a foreground image is anchored within its parent, you can float the image:</p>
<pre><code>div#foreground img {
	float: right;
	}</code></pre>
<p>This anchors the image to the right side of the <code>div</code>, so <a href="http://www.zomigi.com/demo/crop_foreground.html">more or less of its left side shows as the <code>div</code> changes in size</a>. Using a foreground image results in an effect that <a href="http://www.zomigi.com/demo/crop.html">looks exactly like using a background image</a>, but the foreground image has alternative text, and you could also easily add a link to it.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://zomigi.com/blog/foreground-images-that-scale-with-the-layout/' title='Foreground images that scale with the layout'>Foreground images that scale with the layout</a></li>
<li><a href='http://zomigi.com/blog/essential-resources-for-creating-liquid-and-elastic-layouts/' title='70+ essential resources for creating liquid and elastic layouts'>70+ essential resources for creating liquid and elastic layouts</a></li>
<li><a href='http://zomigi.com/blog/creating-sliding-composite-images/' title='Creating sliding composite images'>Creating sliding composite images</a></li>
<li><a href='http://zomigi.com/blog/media-queries-presentation/' title='Media queries presentation at indieconf'>Media queries presentation at indieconf</a></li>
<li><a href='http://zomigi.com/blog/css-summit/' title='Me at The CSS Summit online conference'>Me at The CSS Summit online conference</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zomigi.com/blog/hiding-and-revealing-portions-of-images/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>Foreground images that scale with the layout</title>
		<link>http://zomigi.com/blog/foreground-images-that-scale-with-the-layout/</link>
		<comments>http://zomigi.com/blog/foreground-images-that-scale-with-the-layout/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 21:44:34 +0000</pubDate>
		<dc:creator>Zoe Gillenwater</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[elastic]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[Flexible Web Design]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[liquid]]></category>
		<category><![CDATA[responsive web design]]></category>

		<guid isPermaLink="false">http://zomigi.com/?p=58</guid>
		<description><![CDATA[Simple CSS techniques can make the content images inside your liquid or elastic pages scale with the layout.]]></description>
			<content:encoded><![CDATA[<p class="note">This tutorial is slightly adapted from Chapter 9 of my book, <a href="http://www.amazon.com/gp/product/0321553845?ie=UTF8&amp;tag=zoeshomepage&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0321553845"><em>Flexible Web Design: Creating Liquid and Elastic Layouts with CSS</em></a>. You can download most of <a href="http://www.flexiblewebbook.com/bonus.html">Chapter 9</a> for free as a PDF at the <a href="http://www.flexiblewebbook.com">Flexible Web Design companion site</a>, as well as download the <a href="http://www.flexiblewebbook.com/files.html">HTML, CSS and image files</a> that go along with this tutorial.</p>
<p>Since the area available for an image to display within a flexible layout changes on the fly, your images may need to as well. While fixed-width images can work within flexible layouts—as long as they’re not too large, or you have matching minimum widths in place—there are lots of ways you can dynamically change the screen area that an image takes up.</p>
<p>One way to dynamically alter the footprint of an image is to make it literally scale, based on either the text size or the changing dimensions of its parent element. Both are elegant effects that are deceptively simple to create.<br />
<span id="more-58"></span><br />
Both liquid and elastic scaling images start out with a regular <code>img</code> element in the (X)HTML:</p>
<pre><code>&lt;img src="styx.jpg" alt="my cat Styx"&gt;</code></pre>
<p>Notice that this <code>img</code> element has no <code>width</code> or <code>height</code> attributes, as it normally would. You control the dimensions with CSS instead.</p>
<p>For a liquid image, create a CSS rule to set the image’s width to a percentage value:</p>
<pre><code>img {
  	width: 50%;
  	}</code></pre>
<p class="sidenote">Note: This rule will make all images 50 percent as wide as their parents. In a real page, you would probably add an <code>id</code> or <code>class</code> to the specific image you wanted to scale and use that <code>id</code> or <code>class</code> as the selector in the CSS.</p>
<p>No <code>height</code> value is necessary; the browser determines the height that will proportionately constrain the image’s dimensions. If you were more concerned about making the height of your image stay proportional to its parent’s height than you were with width, you could use the <code>height</code> property in the CSS and leave off the <code>width</code> property. Just make sure not to use the two together.</p>
<p>As with all percentage dimensions, the percentage <code>width</code> value you choose is relative to the width of the parent element. As you change the width of the parent element, the <a href="http://www.zomigi.com/demo/scale_liquid.html">image scales to match</a>.</p>
<p>If you want the image to <a href="http://www.zomigi.com/demo/scale_elastic.html">scale with the text size</a> instead of the width of the parent element, simply change the <code>width</code> value in the CSS to an em value:</p>
<pre><code>img {
  	width: 20em;
  	}</code></pre>
<p>Any time a browser scales an image, there’s going to be some distortion, but you can keep it minimal by starting out with a very large image so the browser will usually be scaling it down.</p>
<p>To assure that the browser <em>always</em> scales the image down, not up, you can set a maximum width on the image that matches its set pixel width:</p>
<pre><code>img {
  	width: 20em;
  	<em>max-width: 500px;</em>
  	}</code></pre>
<p class="tip">Tip: If the image must stay above a certain size to remain “readable,” add a pixel <code>min-width</code> value too.</p>
<p>Now the image will scale <a href="http://www.zomigi.com/demo/scale_elastic_max.html">only until it grows to 500 pixels wide</a>; thereafter it will act as any other fixed-width image.</p>
<h3>Simulate image scaling with JavaScript</h3>
<p>If you don’t want the browser to scale your images at all, yet you want them to change in size based on the amount of space available, you can use JavaScript to swap in differently sized versions of the same image. The JavaScript detects the user’s viewport size and chooses the appropriate version of the image to show. This works in the same way that <a href="http://www.clagnut.com/blog/1663/">resolution-dependent layouts</a> swap in different CSS files based on viewport size.</p>
<p>A live site that uses image-swapping to simulate scaling is <a href="http://www.artlogic.com/">Art &amp; Logic</a>. There are four illustrations under the banner on the home page. Try narrowing or widening your browser window; the images don’t scale in real time in most browsers, but as soon as you stop moving the window, they jump to a different size to match the available new space.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://zomigi.com/blog/hiding-and-revealing-portions-of-images/' title='Hiding and revealing portions of images'>Hiding and revealing portions of images</a></li>
<li><a href='http://zomigi.com/blog/essential-resources-for-creating-liquid-and-elastic-layouts/' title='70+ essential resources for creating liquid and elastic layouts'>70+ essential resources for creating liquid and elastic layouts</a></li>
<li><a href='http://zomigi.com/blog/creating-sliding-composite-images/' title='Creating sliding composite images'>Creating sliding composite images</a></li>
<li><a href='http://zomigi.com/blog/media-queries-presentation/' title='Media queries presentation at indieconf'>Media queries presentation at indieconf</a></li>
<li><a href='http://zomigi.com/blog/css-summit/' title='Me at The CSS Summit online conference'>Me at The CSS Summit online conference</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zomigi.com/blog/foreground-images-that-scale-with-the-layout/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

