<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:gr="http://www.google.com/schemas/reader/atom/" xmlns:idx="urn:atom-extension:indexing" idx:index="no" gr:dir="ltr"><!--
Content-type: Preventing XSRF in IE.

--><generator uri="http://www.google.com/reader">Google Reader</generator><id>tag:google.com,2005:reader/user/18328930614534143407/state/com.google/broadcast</id><title>Max Black's shared items in Google Reader</title><gr:continuation>CPyutcX--KEC</gr:continuation><author><name>Max Black</name></author><updated>2010-05-30T04:52:28Z</updated><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/rssbestpracticeshtmlcss" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="rssbestpracticeshtmlcss" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gr:crawl-timestamp-msec="1275195148915"><id gr:original-id="">tag:google.com,2005:reader/item/0977f133f75a9dab</id><title type="html">Monitor Display Sizes » Best Practices HTML and CSS</title><published>2010-05-30T04:52:28Z</published><updated>2010-05-30T04:52:28Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmonitor.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmonitor.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmonitor.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Monitor Display Sizes&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/monitor.jpg" alt="computer monitor" title="computer monitor"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;Short description of page contents.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;Placeholder for pithy quote.&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmonitor.html#sizes" title="List of Display Sizes"&gt;List of Display Sizes&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmonitor.html#layouts" title="Layouts Fixed or Fluid"&gt;Fixed/Fluid Layouts&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/monitor_go.png" alt="app icon" title="monitor icon"&gt;&lt;/div&gt;
						&lt;p&gt;Monitors come in sizes (i.e. 17 inches, 21 inches, whatever), but we're more concerned with their &lt;em&gt;display sizes&lt;/em&gt;. This tells us how big the actual display of the screen is. The measurement is in PIXELs, which goes along nicely with our use of pixels as units of measurement.&lt;/p&gt;
						
						&lt;p&gt;&lt;strong&gt;A List of Display Sizes (Desktop Computers)&lt;/strong&gt;&lt;/p&gt;
						&lt;dl&gt;
							&lt;dt&gt;&lt;strong&gt;640x480&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;The standard monitor size in the mid-1990s. Almost no one designs for a display this small any more.&lt;/dd&gt;
							&lt;dt&gt;&lt;strong&gt;800x600&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;According to some surveys, less than 5% of users have monitors this small. But many designers still make their designs to accomodate this size.&lt;/dd&gt;
							&lt;dt&gt;&lt;strong&gt;1024x768&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;Currently the "standard" display size. Most designers create their designs with this in mind as their primary size.&lt;/dd&gt;
							&lt;dt&gt;&lt;strong&gt;1280x1024&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;Larger than the current "standard" size, but many users view their Web pages in this display size.&lt;/dd&gt;
							&lt;dt&gt;&lt;strong&gt;1600x1200&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;A significant number of users have displays this large.&lt;/dd&gt;
							&lt;dt&gt;&lt;strong&gt;1900x1220&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;Now we're getting into the high end of display sizes. Most designers don't design for displays this large, unless they're creating "fluid" layouts (see below). If you create a fixed design for a display this large, almost everyone has to horizontally scroll to see your content.&lt;/dd&gt;
							&lt;dt&gt;&lt;strong&gt;Larger display sizes&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;"Vanity" displays, big-screen televisions, and so forth.&lt;/dd&gt;
						&lt;/dl&gt;
						&lt;p&gt;Note that I didn't get into laptop computers (not &lt;em&gt;too&lt;/em&gt; much difference), tablet and notebook computers (often somewhat smaller displays), or mobile devices (very much smaller, and an entirely different subject). These are questions best handled when you get better at Web design.&lt;/p&gt;
						
						&lt;p&gt;&lt;strong&gt;Layouts: "Fixed" or "Fluid"?&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;This question pertains to the kind of "layouts" you will use for your pages — a concept we will cover later.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmonitor.html#nogo" title="coming soon"&gt;More about &lt;em&gt;layouts&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;The simple definitions:&lt;/p&gt;
						&lt;dl&gt;
							&lt;dt&gt;&lt;strong&gt;Fixed width layouts&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;The width is "fixed," or set at a specific number of (usually) pixels. No matter how narrow or how wide the display is, the width of the Web page is the same.&lt;/dd&gt;
							&lt;dt&gt;&lt;strong&gt;Fluid width layouts&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;These adjust themselves based on the width of the user's monitor display, and are usually based on ems or percentages.&lt;/dd&gt;
						&lt;/dl&gt;
						&lt;p&gt;There are subcategories of fluid layouts, particularly the layout style called "elastic." There are also combinations of layouts called "fixed-fluid." We won't go into that here.&lt;/p&gt;
						&lt;p&gt;Which one is better? Neither one is "better." The question is, which choice — fixed or fluid — suit the needs of your users, and which personally appeals to you as a designer. Only you can answer these questions.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275195130669"><id gr:original-id="">tag:google.com,2005:reader/item/1520f1957ee7ae9d</id><title type="html">Accessibility » Best Practices HTML and CSS</title><published>2010-05-30T04:52:10Z</published><updated>2010-05-30T04:52:10Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinaccess.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinaccess.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinaccess.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Accessibility&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/magnify.jpg" alt="magnifying glass on book" title="magnifying glass on book"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;What "accessibility" is, and why your Web sites should be accessible&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;/a&gt;&lt;div&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;
							&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;

						&lt;blockquote&gt;&lt;p&gt;Accessible Web sites provide the maximum potential audience by allowing any Web user to access a site. — &lt;a href="http://htmlhelp.com/design/accessibility/why.html" title="Why Write Accessible Pages"&gt;Web Design Group&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;p&gt;Web specialist &lt;a href="http://www.amazon.com/Essential-Guide-HTML-Design-Essentials/dp/1590599071/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1274231475&amp;amp;sr=1-1" title="The Essential Guide to CSS&#xD;
and HTML Web Design"&gt;Craig Grannell&lt;/a&gt; says it better than I can about Web accessibility&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Designers (and clients paying for their time) aren't the only ones to benefit from CSS. Visitors will, too, in terms of faster download times, but also with regard to &lt;strong&gt;accessibility&lt;/strong&gt;. For instance, people with poor vision often use screen readers to surf the Web. If a site's layout is composed of complex nested tables, it might visually make sense; however, the underlying structure may not be logical. View the source of a document and look at the order of the content. A screen reader reads from the top to the bottom of the code and doesn't care what the page looks like in a visual web browser. Therefore, if the code compromises the logical order of the content (as complex tables often do), the site is compromised for all those using screen readers. Accessibility is now very important in the field of web design. Legislation is regularly passed to strongly encourage designers to make sites accessible for web users with disabilities. It's likely that this trend will continue, encompassing just about everything except personal web pages. (However, even personal websites shouldn’t be inaccessible.)&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;... more coming ...&lt;/p&gt;
						
						&lt;div&gt;&lt;/div&gt;
						
					&lt;/div&gt;
				&lt;/div&gt;
				
				&lt;div&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275195010540"><id gr:original-id="">tag:google.com,2005:reader/item/b6ad53d0baff088d</id><title type="html">The &amp;#39;Design&amp;#39; of Web Design » Best Practices HTML and CSS Lessons</title><published>2010-05-30T04:50:10Z</published><updated>2010-05-30T04:50:10Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindesign.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindesign.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindesign.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;The 'Design' of Web Design&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/indiahands.jpg" alt="tattooed hands" title="illustrative image of tattooed hands"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;A flying look at the idea of "design" in Web design.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;h3&gt;The &lt;em&gt;Design&lt;/em&gt; of Web Design&lt;/h3&gt;
						&lt;blockquote&gt;&lt;p&gt;Web design is the creation of digital environments that facilitate and encourage human activity; reflect or adapt to individual voices and content; and change gracefully over time while always retaining their identity. — &lt;a href="http://www.alistapart.com/articles/understandingwebdesign/" title="Understanding Web Design"&gt;Jeffrey Zeldman&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						&lt;blockquote&gt;&lt;p&gt;The function of design is letting design function. — &lt;a href="http://quotesondesign.com/micha-commeren/" title="Micha Commeren"&gt;Micha Commeren&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindesign.html#standards" title="Web Standards"&gt;Web Standards&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindesign.html#content" title="Focus on Content"&gt;Focus on Content&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindesign.html#read" title="Further Reading"&gt;Further Reading&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindesign.html#cooking" title="The Joy of Cooking"&gt;The Joy of Cooking&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;This site does &lt;em&gt;not&lt;/em&gt; teach design principles in and of themselves. This site will teach you the nuts and bolts of creating Web pages, but it will not teach you how to design them in any artistic sense. Articles by &lt;a href="http://www.smashingmagazine.com/2010/04/08/the-dying-art-of-design/" title="Francisco Inchauste"&gt;Francisco Inchauste&lt;/a&gt;, &lt;a href="http://www.andyrutledge.com/contrast-and-meaning.php" title="Contrast and Meaning"&gt;Andy Rutledge&lt;/a&gt;, and &lt;a href="http://artbackwash.blogspot.com/2009/06/dont-be-tooler.html" title="Don&amp;#39;t be a Tooler"&gt;Von Glitschka&lt;/a&gt;, among many others, address the topic of design vs. tool — art vs. craft, if you will.&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Design began like any craft: people practiced it, studied it and challenged themselves. While modern design tools and resources certainly make our many tasks easier, they don’t always improve our work. Tools and shortcuts are temporary. Great design is timeless. The best tool available is sitting in our heads; we just need to upgrade it once in a while. — &lt;a href="http://www.smashingmagazine.com/2010/04/08/the-dying-art-of-design/" title="Francisco Inchauste"&gt;Francisco Inchauste&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;If the entire idea of "designing for the Web" leaves you drawing a blank, &lt;a href="http://www.andyrutledge.com/contrast-and-meaning.php" title="Contrast and Meaning"&gt;read Rutledge's article&lt;/a&gt; for a good introduction to the concepts underlying basic design. His example of transforming the "About copy" and "Registration copy" of the product "Optimizr" from static, undifferentiated text to a graphically driven, highly structured and reorganized is one of several excellent visual examples of how design drives and enhances function and form. Also, you might take his &lt;a href="http://www.andyrutledge.com/creativity-is-not-design-test-2.php" title="Creativity is Not Design Design Test 2"&gt;design test&lt;/a&gt; to assess your knowledge of, and responses to, the fundamentals of design. (You can't cheat, because Andy didn't give an answer key!) In fact, just &lt;a href="http://www.andyrutledge.com/" title="Design View"&gt;explore the various design and design-related articles on Rutledge's site&lt;/a&gt;. He is not the be-all end-all of Web design, and &lt;a href="http://www.andyrutledge.com/the-demise-of-american-exceptionalism.php" title="The Demise of American Exceptionalism"&gt;his political views are far from my own&lt;/a&gt;, but his work, acerbic and opinionated as it is, is an excellent starting point for those who want to transcend HTML and CSS nuts and bolts.&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Designing for the Web, as I see it, is a multi-layered process. It's a process in which each layer addresses specific design needs related to client aims, brand characteristics and site user habits and expectations. Sadly, the last of these layers to be applied in the process, the application of style, is an oft-maligned element of design. Style for its own sake or by itself is not design, certainly, but stylistic concerns are important to successful design. — &lt;a href="http://www.andyrutledge.com/style-layer.php" title="The Layers of Design: the style layer"&gt;Andy Rutledge&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Web Standards&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;One area of Web design I have bought into, in large part because of my connection to SitePoint but also because of personal inclination, is the notion that &lt;em&gt;web standards are important&lt;/em&gt;.&lt;/p&gt;
						&lt;p&gt;When you think about it, most browsers are incredibly forgiving of errors. Even if you code in strict HTML (or XHTML), the browsers will put up with a lot of "guff" from designers — badly written code, improper implementations, a certain amount of misspellings, chaotic structure, and many other errors and poor practices, and still make a manful effort to display a Web page in some sort of decent presentation.&lt;/p&gt;
						&lt;p&gt;A lot of designers — including some very skilled ones both amateur and professional — figure that if a browser will display something written a particular way, it's okay to code it that way even if it violates all notions of Web standards. They'll tell you that if it works, if it's easier, then they have no problem coding with non-standard techniques, and Web standards — and validation — is not particularly relevant.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinvalid.html" title="Web Design Principles Validation"&gt;More about &lt;em&gt;validation&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;They have some reasonable arguments, but I don't entirely buy them. There are a number of reasons why I advocate designing to standards (as much as humanly possible). Many of those arguments are detailed in the Validation page linked above.&lt;/p&gt;
						&lt;p&gt;Designer &lt;a href="http://geek.focalcurve.com/crashcourse-part1/" title="Web Standards A Crash Course"&gt;Craig Cook&lt;/a&gt; gives his definition of Web standards:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;[W]eb standards are the functional specifications for the core languages the web is built on. They define how user-agents should handle and interpret these languages, and how web authors should write them.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Like most designers, Cook bases his standards on those hewn out by the &lt;span title="World Wide Web Consortium"&gt;W3C&lt;/span&gt;, which has, since the inception of the World Wide Web, given us a set of guidelines and &lt;span&gt;best practices&lt;/span&gt; that help us build sites that display well in all modern browsers.&lt;/p&gt;
						&lt;p&gt;Cook continues:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;For one computer to understand another, they need to speak the same language and follow the same rules. So you can think of web standards as the rules of grammar that make web languages understandable. Assuming that web browsers are programmed according to the specifications, we need to speak a language the browsers can understand to get our message across. By the same token, a browser manufacturer who wants their software to operate correctly needs to build it so it correctly interprets the language as it is written.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Most — &lt;span title="Yes, we&amp;#39;re looking at you, Internet Explorer"&gt;not all&lt;/span&gt; — browsers interpret standards-compliant Web designs in virtually the same way. A design that looks one way in Firefox, for example, will display (almost) identically in Opera, or Camino, or (mostly) Internet Explorer. This was &lt;em&gt;not&lt;/em&gt; always the case. However, now is not the time to re-examine the Great Browser Wars of the late 1990s and early 2000s. Suffice it to say that with the occasionally maddening exception of Internet Explorer versions 6 and 7 (and sometimes 8), and rare quirkiness from the other modern browsers out there, browsers implement CSS fairly thoroughly, and that in turn enables us to construct &lt;a href="http://www.csszengarden.com/" title="CSS Zen Garden"&gt;elegant, beautifully designed Web pages&lt;/a&gt; that look almost the same from one browser to the next.&lt;/p&gt;
						&lt;p&gt;Chris Mills, a developer for Opera, writes &lt;a href="http://dev.opera.com/articles/view/1-introduction-to-the-web-standards-cur/" title="Introduction to The Web Standards Curriculum"&gt;a brief synopsis of where Web design was before standards were widely implemented&lt;/a&gt;. It's an excellent reminder of where we were then, and how much progress has been made up through now.&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;In the old days, people used to do things like laying out their web sites inside giant tables, using the different table cells to position their graphics, text etc (not what tables were intended for, adds superfluous markup to the page). They used to use invisible images called spacer GIFs to fine tune positioning of page elements (not what images are intended for, add superfluous markup and images to the page). They used to write JavaScript that generated menus etc on the fly (no good for people with JavaScript disabled in their browsers, or people with visual impairments using screenreaders, which get confused by such JavaScript) or worked on only one browser (what about people using other browsers?). They used to insert styling information directly into the HTML using &amp;lt;font&amp;gt; elements (terrible for maintenance, and adds superfluous markup to the page). And many other crimes against web development. The worst thing is that I say &amp;quot;in the old days&amp;quot; above, but the fact is that a lot of people are still doing things like this!&lt;/p&gt;
						&lt;p&gt;Web development is a messy skill at the best of times, but bad practices like these just make it harder. Using web standards and best practices, as outlined in this course, is the best way to go.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;The Three Layers of a Web Site&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Like the cakes your mom might bake (not mine, she despised baking), Web sites are made up of three &lt;em&gt;layers&lt;/em&gt;. (This part of the page owes a great deal to Cook's lucid descriptions.)&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;&lt;em&gt;Content&lt;/em&gt; — HTML or XHTML&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Presentation&lt;/em&gt; — CSS&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Behavior — JavaScript or another client-side scripting language&lt;/em&gt;&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;The HTML &lt;em&gt;content layer&lt;/em&gt; tells the browser how to denote the different parts of the document, and what each part means. This provides the basic structure for a Web page, and can be considered the "bottom layer."&lt;/p&gt;
						&lt;p&gt;The CSS &lt;em&gt;presentation layer&lt;/em&gt; tells the browser how to visually display the Web page. It is the "second layer" of the site, controlling the appearance of the site but leaving the structure intact.&lt;/p&gt;
						&lt;p&gt;The JavaScript &lt;em&gt;behavior layer&lt;/em&gt; tells the browser what to do when certain "events" occur, letting both the user and the designer manipulate some parts of the Web page to allow enhanced functionality and interactivity.&lt;/p&gt;
						&lt;p&gt;Cook sums up the integrated functionality of the three layers:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;These are different languages performing different tasks. When these facets of the page are all mixed together, the language becomes muddy and difficult to understand. But if we separate the layers, we end up with three distinct-yet-connected beings, each of which can be modified and maintained without interfering with the others. Each layer then becomes lighter and stronger.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;&lt;span&gt;Note:&lt;/span&gt; Cook provides a clear distinction between the terms "document" and "page," a distinction I had not considered before reading his article. He writes that a document is "[t]he plain text file containing the content and markup which is served to the browser," while a page consists of "[t]he content (text, images, objects) when rendered by a browser." To differentiate: "a page is what you see, but the document is what you build." Excellent distinction, and one I intend to follow through the course of this site, even if I have to reverse-engineer some of the already-written pages.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Focus on Content&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Michael Seidel, a usability and content management expert, &lt;a href="http://contente.org/content-as-visual-design" title="Content as Visual Design"&gt;writes of the need to focus on content first and foremost&lt;/a&gt; in your designs. Content is indeed "the seed of the design process," he writes, but the structuring and formatting of content is itself an integral part of visual design. Seidel writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;You can strategize until you're blue in the face about what your content should be and how it will be created and maintained. But ignore how it will be presented and your content will flounder once it leaves your cozy den of theory and hits the real world.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Seidel writes that he is talking about "simple formatting":&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;Strong headings,&lt;/li&gt;
							&lt;li&gt;Bullet points,&lt;/li&gt;
							&lt;li&gt;Short sentences, and&lt;/li&gt;
							&lt;li&gt;Scannable paragraphs&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;Seidel writes that no matter how obvious these elements may seem in their necessity for creating usable designs, designers forget it over and over again. He bemoans the prevalence of "impossibly cluttered and kludgy design" even on today's Web.&lt;/p&gt;
						&lt;p&gt;Seidel writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Your readers need content they can kiss. Don't make it a complicated kind of love. Break things down to their core. Written content with a strong visual hierarchy helps simplify the creation process. It helps designers build clean, purposeful interfaces.&lt;/p&gt;
						&lt;p&gt;These things matter.&lt;/p&gt;
						&lt;p&gt;Never forget.&lt;/p&gt;
						&lt;p&gt;Formatting may seem like minutia, but it's not. Make sure that content design is a key part of your content strategy equation. Fretting over style will pay off in crazy amounts in the long run.&lt;/p&gt;&lt;/blockquote&gt;					
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;The Joy of Cooking&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Designer and content strategist Nicole Jones serves us a useful metaphor: &lt;a href="http://weblog.muledesign.com/2010/05/design_is_like_cooking.php" title="Design is Like Cooking Plan, Prep, and Plate"&gt;design is like cooking a meal&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Before you begin cooking, Jones writes, a chef does some planning. Who are the guests? What do they like and dislike? How are they feeling — what is their mindset? What are they coming to eat? (Patrons visiting a restaurant specializing in local seafood would be surprised to be told that the evening's special is meatloaf.) What is available at that time of year?&lt;/p&gt;
						&lt;p&gt;A good designer asks similar questions. Who is the site for? What do the likely users prefer, and what do they avoid? How are they likely to approach the site? What do they expect to be able to do upon clicking into the site? What can the designer provide, and what is beyond his capabilities or inclinations?&lt;/p&gt;
						&lt;p&gt;Building on her metaphor, Jones continues:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;A great chef is an accomplished editor; the entire experience matters. The menu is consistently good from start to finish, without overt techniques or an overwhelming amount of ingredients. The chef disappears. The food is not intimidating, precious, or minimal. ... After all, a delicious meal is not a masterpiece. It's sweet and savory, and intended to be eaten.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;She concludes that designers "ask questions, cook with the diner in mind, and use [their] tools responsibly."&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Further Reading&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Jeffrey Zeldman, the dean of Web design, gives us &lt;a href="http://www.alistapart.com/articles/understandingwebdesign/" title="Understanding Web Design"&gt;a wake-up call&lt;/a&gt; about the misconceptions that make up most people's perceptions of the concepts behind Web design.&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;It's hard to understand web design when you don't understand the web. And it's hard to understand the web when those who are paid to explain it either don't get it themselves, or are obliged for commercial reasons to suppress some of what they know, emphasizing the Barnumesque over the brilliant. — &lt;a href="http://www.alistapart.com/articles/understandingwebdesign/" title="Understanding Web Design"&gt;Jeffrey Zeldman&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Steven Bradley has given us a &lt;a href="http://www.smashingmagazine.com/2010/04/26/designing-for-a-hierarchy-of-needs/" title="Designing For A Hierarchy Of Needs"&gt;Design Hierarchy of Needs&lt;/a&gt;, ranking five fundamentals of design from the most basic need of &lt;em&gt;functionality&lt;/em&gt; — the site must function properly — through &lt;em&gt;reliability, usability, proficiency&lt;/em&gt;, and finally &lt;em&gt;creativity&lt;/em&gt; as necessary elements of any Web site's design. A recommended read.&lt;/p&gt;
						&lt;p&gt;David Rodriguez &lt;a href="http://www.wpdfd.com/issues/87/where_design_really_fits/" title="Where Design Really Fits"&gt;attempts to find the middle ground&lt;/a&gt; in (business-oriented) Web design between unbridled creativity and bland, generic "corporatism."&lt;/p&gt;
						&lt;p&gt;A much more narrowly focused article from Sam Dunn focuses on &lt;a href="http://buildinternet.com/2009/06/five-minute-upgrade-making-your-design-pop/" title="Making Your Design Pop"&gt;several excellent methods for strengthening the visual appeal&lt;/a&gt; of your site.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.csszengarden.com/" title="CSS Zen Garden"&gt;CSS Zen Garden&lt;/a&gt; is one of the best places on the Internet to begin looking over Web designs. Anyone can submit a site (re)design; the HTML remains exactly the same for every version of the site, but the CSS is dramatically different from one submission to the next. One person's version might be &lt;a href="http://www.csszengarden.com/?cssfile=/212/212.css&amp;amp;page=0" title="Make &amp;#39;em Proud"&gt;militaristic and sharp-edged&lt;/a&gt;, while another might take you into a &lt;a href="http://www.csszengarden.com/?cssfile=/210/210.css&amp;amp;page=0" title="Oceanscape"&gt;bright blue oceanscape&lt;/a&gt;. A seminal showcase of the infinite variety of aesthetic, concept, and function that can be produced for the Web.&lt;/p&gt;
						&lt;p&gt;More reading and content will be added periodically.&lt;/p&gt;
						
						&lt;div&gt;&lt;/div&gt;
						
						&lt;blockquote&gt;&lt;p&gt;The evolution of a website can equally be put down to a mixture of nature (what the coder puts into the site) and nurture (what the end-user adds with growth), both of which have significant importance and shouldn't be ignored. — &lt;a href="http://sixrevisions.com/web-technology/anatomy-of-a-website/" title="The Anatomy of a Website"&gt;Alex Dawson&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						&lt;blockquote&gt;&lt;p&gt;Keep in mind that a &lt;em&gt;user&lt;/em&gt; is simply a human being, an average Joe, a passerby on the street who might be a web-savvy tech-support guru, or an elderly lady who's only just started using a computer. People use web sites, so it's a handy term, but just try to keep in mind that we're talking about regular humans, rather than some kind of machine-operating robot. — &lt;a href="http://www.sitepoint.com/books/sexy1/" title="Sexy Web Design"&gt;Elliot Jay Stocks&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						&lt;blockquote&gt;&lt;p&gt;Simplicity is the ultimate sophistication. — &lt;a href="http://quotesondesign.com/leonardo-da-vinci/" title="Leonardo Da Vinci"&gt;Leonardo Da Vinci&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						
					&lt;/div&gt;
				&lt;/div&gt;
				
				&lt;div&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194979775"><id gr:original-id="">tag:google.com,2005:reader/item/fe286aa1d66d3116</id><title type="html">Commenting in CSS » Best Practices HTML and CSS</title><published>2010-05-30T04:49:39Z</published><updated>2010-05-30T04:49:39Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princommcss.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princommcss.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princommcss.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Commenting in CSS&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/wordbubble.jpg" alt="cartoon word bubble" title="cartoon word bubble"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;Short description of page contents.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;p&gt;&lt;strong&gt;Principles Menu&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;Placeholder for pithy quote.&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;Commenting in your stylesheet follows a different format, but the same idea, as commenting in your HTML page. Here's how you leave yourself a comment in your stylesheet:&lt;/p&gt;
						&lt;pre&gt;/*here's my comment*/&lt;/pre&gt;
						&lt;p&gt;The &lt;code&gt;/* */&lt;/code&gt; is the key to setting the comments apart and keeping the browser from trying, and failing, to interpret them as CSS elements.&lt;/p&gt;
						&lt;p&gt;Me, I like to set them off a bit more: &lt;code&gt;/***  ***/&lt;/code&gt;. That's okay, just be careful not to overdo it. You can do this if you really want:&lt;/p&gt;
						&lt;pre&gt;/******************&lt;br&gt;******************&lt;br&gt;******************&lt;br&gt;Lots of blither about me!&lt;br&gt;My code is wonderful! Here's my contact info.&lt;br&gt;Here's information about my cats.&lt;br&gt;More pointless gibberish that slows loading time.&lt;br&gt;Wheeeee!&lt;br&gt;******************&lt;br&gt;******************&lt;br&gt;******************/&lt;/pre&gt;
						&lt;p&gt;but why do you want to?&lt;/p&gt;					
						&lt;p&gt;Just a reminder, make sure the &lt;code&gt;/*  */&lt;/code&gt; begin and end the comment.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194924873"><id gr:original-id="">tag:google.com,2005:reader/item/1c6816d823401e9a</id><title type="html">Color » Best Practices HTML and CSS</title><published>2010-05-30T04:48:44Z</published><updated>2010-05-30T04:48:44Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princolor.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princolor.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princolor.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Color&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/indiatruck.jpg" alt="truck bearing colorful items" title="truck bearing colorful items"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;A brief examination of color in Web design.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;Placeholder for pithy quote.&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princolor.html#hex" title="Hex Values"&gt;Hex Values&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princolor.html#rgb" title="RGB Values"&gt;RGB Values&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princolor.html#safe" title="216 Web-Safe Colors"&gt;216 "Web-Safe" Colors&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;We've already seen that we prefer to use &lt;span&gt;hex codes&lt;/span&gt; instead of the names of colors for our CSS. If you use hex codes, you have tens of thousands of choices of colors. If you use names, you have a grand total of 16: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.&lt;/p&gt;
						
						&lt;h4&gt;The 16 Named Colors:&lt;/h4&gt;
						&lt;table&gt;
								&lt;tbody&gt;&lt;tr&gt;
									&lt;td style="background-color:black"&gt;&lt;/td&gt;
									&lt;td&gt;black&lt;/td&gt;
									&lt;td style="background-color:gray"&gt;&lt;/td&gt;
									&lt;td&gt;gray&lt;/td&gt;
									&lt;td style="background-color:silver"&gt;&lt;/td&gt;
									&lt;td&gt;silver&lt;/td&gt;
									&lt;td style="background-color:white"&gt;&lt;/td&gt;
									&lt;td&gt;white&lt;/td&gt;
								&lt;/tr&gt;
								&lt;tr&gt;
									&lt;td style="background-color:yellow"&gt;&lt;/td&gt;
									&lt;td&gt;yellow&lt;/td&gt;
									&lt;td style="background-color:lime"&gt;&lt;/td&gt;
									&lt;td&gt;lime&lt;/td&gt;
									&lt;td style="background-color:aqua"&gt;&lt;/td&gt;
									&lt;td&gt;aqua&lt;/td&gt;
									&lt;td style="background-color:fuchsia"&gt;&lt;/td&gt;
									&lt;td&gt;fuchsia&lt;/td&gt;
								&lt;/tr&gt;
								&lt;tr&gt;
									&lt;td style="background-color:red"&gt;&lt;/td&gt;
									&lt;td&gt;red&lt;/td&gt;
									&lt;td style="background-color:green"&gt;&lt;/td&gt;
									&lt;td&gt;green&lt;/td&gt;
									&lt;td style="background-color:blue"&gt;&lt;/td&gt;
									&lt;td&gt;blue&lt;/td&gt;
									&lt;td style="background-color:purple"&gt;&lt;/td&gt;
									&lt;td&gt;purple&lt;/td&gt;
								&lt;/tr&gt;
								&lt;tr&gt;
									&lt;td style="background-color:maroon"&gt;&lt;/td&gt;
									&lt;td&gt;maroon&lt;/td&gt;
									&lt;td style="background-color:olive"&gt;&lt;/td&gt;
									&lt;td&gt;olive&lt;/td&gt;
									&lt;td style="background-color:navy"&gt;&lt;/td&gt;
									&lt;td&gt;navy&lt;/td&gt;
									&lt;td style="background-color:teal"&gt;&lt;/td&gt;
									&lt;td&gt;teal&lt;/td&gt;
								&lt;/tr&gt;
						&lt;/tbody&gt;&lt;/table&gt;

						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;(Chart adapted from &lt;a href="http://www.tizag.com/htmlT/htmlcolorcodes.php" title="Tizag HTML Tutorial"&gt;Tizag.com&lt;/a&gt;.)&lt;/p&gt;
						&lt;p&gt;I don't know about you, but I want more than 16 color choices!&lt;/p&gt;
						&lt;p&gt;There are two general ways to add color to your site through your stylesheet: &lt;code&gt;color&lt;/code&gt; for fonts, and &lt;code&gt;background-color&lt;/code&gt; for elements such as headers, paragraphs, lists, blockquotes, and other items.&lt;/p&gt;
						&lt;p&gt;Here's an example:&lt;/p&gt;
						&lt;pre&gt;h1 {
   color: #ffcccc;
   background-color: #000099;
}&lt;/pre&gt;
						&lt;p&gt;Now let's break it down.&lt;/p&gt;
						&lt;p&gt;Your &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; font is displayed with the color &lt;code&gt;#ffcccc&lt;/code&gt;.  The background of that &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; element is &lt;code&gt;#000099&lt;/code&gt;.&lt;/p&gt;
						&lt;p&gt;There is one other way to indicate color, &lt;code&gt;RGB&lt;/code&gt;. We won't learn that here, except as it's quoted in the reference below.&lt;/p&gt;
						&lt;p&gt;You can also use "shorthand" for certain hex codes, but I won't get into that here.&lt;/p&gt;
						&lt;p&gt;This is a quote from HTML Dog:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;red&lt;br&gt;
Is the same as&lt;br&gt;
rgb(255,0,0)&lt;br&gt;
Which is the same as&lt;br&gt;
rgb(100%,0%,0%)&lt;br&gt;
Which is the same as&lt;br&gt;
#ff0000&lt;br&gt;
Which is the same as&lt;br&gt;
#f00&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Almost poetic, isn't it? Web design haiku.&lt;/p&gt;
						
						&lt;p&gt;&lt;strong&gt;Hex Values&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;We were just looking at hex values for colors. You're going to end up using them, like it or not. Understanding them completely is, at least for me, not entirely necessary. I crib from charts such as &lt;a href="http://www.december.com/html/spec/color.html" title="December.com&amp;#39;s Hex Hubs"&gt;this one&lt;/a&gt;, which we've used in the lessons, or color scheme generators such as &lt;a href="http://kuler.adobe.com/" title="Kuler"&gt;Adobe's Kuler&lt;/a&gt;, and don't worry too much about it. But that's not a good enough place to leave it. Let's explore the wonderfully confusing world of hex values for just a moment.&lt;/p&gt;
						&lt;p&gt;Hex, or &lt;em&gt;hexadecimal&lt;/em&gt;, values, make up the standard for color representation in Web pages. A hex value is a 6 digit representation of a color. The first two digits (RR) represent a red value, the next two are a green value (GG), and the last are the blue value (BB).&lt;/p&gt;
						&lt;p&gt;In other words, the six-digit code is actually three pairs of code. That's important. We'll see why later.&lt;/p&gt;
						
						&lt;h4&gt;Hexadecimal Color Values:&lt;/h4&gt;
						&lt;table&gt;
							&lt;tbody&gt;&lt;tr&gt;
								&lt;td&gt;&lt;strong&gt;Decimal&lt;/strong&gt;&lt;/td&gt;
								&lt;td&gt;0&lt;/td&gt;
								&lt;td&gt;1&lt;/td&gt;
								&lt;td&gt;2&lt;/td&gt;
								&lt;td&gt;3&lt;/td&gt;
								&lt;td&gt;4&lt;/td&gt;
								&lt;td&gt;5&lt;/td&gt;
								&lt;td&gt;6&lt;/td&gt;
								&lt;td&gt;7&lt;/td&gt;
								&lt;td&gt;8&lt;/td&gt;
								&lt;td&gt;9&lt;/td&gt;
								&lt;td&gt;10&lt;/td&gt;
								&lt;td&gt;11&lt;/td&gt;
								&lt;td&gt;12&lt;/td&gt;
								&lt;td&gt;13&lt;/td&gt;
								&lt;td&gt;14&lt;/td&gt;
								&lt;td&gt;15&lt;/td&gt;
							&lt;/tr&gt;
							&lt;tr&gt;
								&lt;td&gt;&lt;strong&gt;Hexadecimal&lt;/strong&gt;&lt;/td&gt;
								&lt;td&gt;0&lt;/td&gt;
								&lt;td&gt;1&lt;/td&gt;
								&lt;td&gt;2&lt;/td&gt;
								&lt;td&gt;3&lt;/td&gt;
								&lt;td&gt;4&lt;/td&gt;
								&lt;td&gt;5&lt;/td&gt;
								&lt;td&gt;6&lt;/td&gt;
								&lt;td&gt;7&lt;/td&gt;
								&lt;td&gt;8&lt;/td&gt;
								&lt;td&gt;9&lt;/td&gt;
								&lt;td&gt;A&lt;/td&gt;
								&lt;td&gt;B&lt;/td&gt;
								&lt;td&gt;C&lt;/td&gt;
								&lt;td&gt;D&lt;/td&gt;
								&lt;td&gt;E&lt;/td&gt;
								&lt;td&gt;F&lt;/td&gt;
							&lt;/tr&gt;
						&lt;/tbody&gt;&lt;/table&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;(Chart again adapted from &lt;a href="http://www.tizag.com/htmlT/htmlcolorcodes.php" title="Tizag HTML Tutorial"&gt;Tizag.com&lt;/a&gt;. Thanks, folks.)&lt;/p&gt;
						&lt;p&gt;Note that instead of using double-digit numeric values, hex codes use 0-9 and then A-F.&lt;/p&gt;
						&lt;p&gt;0 is the minimum (actually, nil) amount of a color in a hex value. F is the maximum amount. Hence, &lt;code&gt;#000000&lt;/code&gt; — no color — is &lt;em&gt;black&lt;/em&gt;, and &lt;code&gt;#ffffff&lt;/code&gt; — full values for red, green, and blue — is &lt;em&gt;white&lt;/em&gt;.&lt;/p&gt;
						&lt;p&gt;Want more? That gets you into &lt;em&gt;color theory,&lt;/em&gt; which I won't get into here.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Hex Shortcuts&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Pssst! You can use shortcuts in writing your hex codes. Well, sometimes.&lt;/p&gt;
						&lt;p&gt;Remember I told you that hex codes come in three sets of pairs? That's the basis for hex shortcuts.&lt;/p&gt;
						&lt;p&gt;If a pair of color values — say, &lt;code&gt;00&lt;/code&gt; or &lt;code&gt;aa&lt;/code&gt; — is the same, you can get away with using it only once in your stylesheet.&lt;/p&gt;
						&lt;p&gt;Therefore, you can use three digits in your code instead of six. Saves a little wear and tear on your long-suffering fingers. Here's a couple of examples:&lt;/p&gt;
						&lt;pre&gt;color=#000000;&lt;/pre&gt;
						&lt;p&gt;becomes&lt;/p&gt;
						&lt;pre&gt;color=#000;&lt;/pre&gt;
						&lt;p&gt;We didn't just trim three 0s off the end, we trimmed one off of each pair of zeroes:&lt;/p&gt;
						&lt;p&gt;0&lt;span&gt;0&lt;/span&gt; 0&lt;span&gt;0&lt;/span&gt; 0&lt;span&gt;0&lt;/span&gt;&lt;/p&gt;
						&lt;p&gt;One more:&lt;/p&gt;
						&lt;pre&gt;color=#bb7733;&lt;/pre&gt;
						&lt;p&gt;becomes&lt;/p&gt;
						&lt;pre&gt;color=#b73;&lt;/pre&gt;
						&lt;p&gt;We trimmed the second of each pair:&lt;/p&gt;
						&lt;p&gt;b&lt;span&gt;b&lt;/span&gt; 7&lt;span&gt;7&lt;/span&gt; 3&lt;span&gt;3&lt;/span&gt;&lt;/p&gt;
												
						&lt;p&gt;&lt;strong&gt;RGB Values&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Honestly, I almost never use RGB values in my coding, mostly because I can't keep them straight, but also because some old non-Internet Explorer browsers don't recognize them. (With the advent of &lt;em&gt;rgba&lt;/em&gt; values being used in CSS3, I am going to have to learn.) In the meantime, here's a quick rundown.&lt;/p&gt;
						&lt;p&gt;RGB stands for &lt;em&gt;Red, Green, Blue&lt;/em&gt;. Every color has a value of 0 (no color) to 255 (full color). The format in your stylesheet for using white in RGB value is:&lt;/p&gt;
						&lt;pre&gt;background-color="rgb(255,255,255)";&lt;/pre&gt;
						
						&lt;p&gt;&lt;strong&gt;216 "Web-Safe" Colors&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Older Web tutorials advised folks to only use a group of 216 "web-safe" colors. These are "paired" hex code values such as &lt;code&gt;#cc0033&lt;/code&gt; or &lt;code&gt;#22ffdd&lt;/code&gt;. The reason for this is that, in older browsers and monitors, they were the only colors that could be "guaranteed" to display the same from one computer to the next. However, with more modern browsers and monitor displays, almost no one follows this any longer. You can find &lt;a href="http://www.web-source.net/216_color_chart.htm" title="216 Web Safe Colors"&gt;color charts of web-safe colors hanging around the Internet&lt;/a&gt;, but I wouldn't worry about it.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194865123"><id gr:original-id="">tag:google.com,2005:reader/item/73b4843dd6e2613b</id><title type="html">Units of Measuring Size » Best Practices HTML and CSS</title><published>2010-05-30T04:47:45Z</published><updated>2010-05-30T04:47:45Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinsize.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinsize.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinsize.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Units of Measuring Size&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/pixels.jpg" alt="pixels on LCD screen" title="pixels on LCD screen"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;Short description of page contents.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;Placeholder for pithy quote.&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinsize.html#pixel" title="Pixel"&gt;Pixel&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinsize.html#em" title="Em"&gt;Em&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinsize.html#percentages" title="Percentages"&gt;Percentages&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinsize.html#flow" title="Going With the Flow"&gt;Going With the Flow&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;Units of measurement directly impact your "layouts," which we will cover in a later portion of these lessons.&lt;/p&gt;
						&lt;p&gt;Unfortunately, it's somewhat confusing. So pull your pants up and let's roll!&lt;/p&gt;
						&lt;p&gt;There are three units of size (width and length, basically) that you use in determining the size of your Web page, and the size of the various elements (most often fonts, but other elements also):&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;pixels (px)&lt;/li&gt;
							&lt;li&gt;ems (em)&lt;/li&gt;
							&lt;li&gt;percentages (%)&lt;/li&gt;
						&lt;/ul&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Pixel:&lt;/strong&gt; &lt;em&gt;Pixels&lt;/em&gt; are the tiny dots that make up the display on a computer screen. Everything that shows up on a computer screen is displayed in &lt;em&gt;pixels&lt;/em&gt;. It's fairly standard from one computer to another, so it's pretty close to an &lt;em&gt;absolute&lt;/em&gt; size. A typical font size is &lt;code&gt;16px&lt;/code&gt;. &lt;em&gt;Pixels&lt;/em&gt; have their drawbacks: Internet Explorer users can't resize text set in &lt;em&gt;pixels&lt;/em&gt;, which may frustrate the ones with vision problems, and sometimes trying to print a Web page set in &lt;em&gt;pixels&lt;/em&gt; can cause problems. (IE7 and IE8 users can use "page zoom" to resize their entire page, as can Opera users. Doesn't solve the problem, but gets around it somewhat.)&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Em:&lt;/strong&gt; &lt;em&gt;Ems&lt;/em&gt; are a &lt;em&gt;relative&lt;/em&gt; size, which means they change depending on the size of the elements they are "related" to. It is generally related to the font size. So the size &lt;code&gt;2em&lt;/code&gt; is twice the size of the current font size. Using &lt;em&gt;ems&lt;/em&gt; is considered &lt;span&gt;best practice&lt;/span&gt; by many designers. However, there is a drawback: Internet Explorer 6 sometimes renders fonts set in &lt;em&gt;ems&lt;/em&gt; as considerably larger (or smaller) than other browsers. Since I hate IE6 and &lt;a href="http://ie6funeral.com/" title="IE6 funeral"&gt;wish it were dead&lt;/a&gt;, I wouldn't recommend that you not use &lt;em&gt;ems&lt;/em&gt; to serve IE6's orneriness (and I am very aware that many users have to use IE6 in their workplaces, or are just not knowledgeable enough to know they have other options). Overall, while there are issues surrounding the use of &lt;em&gt;ems&lt;/em&gt;, &lt;a href="http://www.alistapart.com/articles/howtosizetextincss/" title="How to Size Text in CSS"&gt;they tend to work the best in Web pages&lt;/a&gt;. Nothing is perfect....&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Percentages:&lt;/strong&gt;This is an even more relative unit of measurement. You might have a font as &lt;code&gt;80%&lt;/code&gt; of the main font size.&lt;/p&gt;
						&lt;p&gt;There are other ways to measure the size of elements, including &lt;em&gt;points, picas, centimeters, millimeters,&lt;/em&gt; and others, but we stick with &lt;em&gt;pixels&lt;/em&gt;, &lt;em&gt;ems&lt;/em&gt;, and &lt;em&gt;percentages&lt;/em&gt; virtually all of the time. (&lt;em&gt;Points&lt;/em&gt; were introduced from the world of printing, and don't translate well into Web work. The others are even worse for Web design.)&lt;/p&gt;
						&lt;p&gt;A measurement value of zero (0) doesn't need a unit of measurement.&lt;/p&gt;
						&lt;p&gt;This is correct:&lt;/p&gt;
						&lt;pre&gt;border: 0;&lt;/pre&gt;
						&lt;p&gt;This is not correct:&lt;/p&gt;
						&lt;pre&gt;border: 0px;&lt;/pre&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Going With the Flow&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Remember, you &lt;span&gt;cannot&lt;/span&gt; make a visitor to your site view your site exactly the same as everyone else, no matter how much you may want to. The phrase "go with the flow" has more than a philosophical or slang meaning for Web designers — you literally have to go with the flow of the browser and the computer display.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.sitepoint.com/books/html2/" title="Build Your Own Web Site The Right Way"&gt;Ian Lloyd&lt;/a&gt; gives us an excellent primer on when to use pixels, ems, and percentages. I'm taking the liberty of including a rather long quote from his book. It's just that good.&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Which method of measurement should you use for your padding: pixels, ems, or percentages? If each of the examples above creates the same effect on the web page, what difference does your choice make? The answer is: it depends on how you want your design to behave. If you intend your design to change with the browser window, then percentages is the way to go. Any value that's set using percentages will change as the size of the browser window changes: the bigger the browser window, the bigger your padding will become. If you want your design to scale well with different font sizes, then you should use ems, because the measurements will be based on how your users set the font size in their browsers. If users increase their browsers' font sizes, then sizes set
in ems will also increase accordingly. If you're after a precise design with graphical elements that line up exactly, regardless of browser window size or font setting, then setting sizes in pixels is the most predictable method of all. A pixel will nearly always represent a single dot on the user's screen. Why nearly? Because most browsers now offer a page zoom facility which will magnify everything in proportion, over which you have little control.&lt;/p&gt;&lt;/blockquote&gt;
						
					&lt;/div&gt;
				&lt;/div&gt;
				
				&lt;div&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194826389"><id gr:original-id="">tag:google.com,2005:reader/item/05193fa01af7e0ec</id><title type="html">Page Layouts » Best Practices HTML and CSS</title><published>2010-05-30T04:47:06Z</published><updated>2010-05-30T04:47:06Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinlayout.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinlayout.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinlayout.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Page Layouts&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/city.jpg" alt="aerial view of city layout" title="aerial view of city layout"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;Some of the fundamental principles behind the page layout.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;

						&lt;blockquote&gt;&lt;p&gt;The experienced web designer, like the talented newspaper art director, accepts that many projects she works on will have headers and columns and footers. Her job is not to whine about emerging commonalities but to use them to create pages that are distinctive, natural, brand-appropriate, subtly memorable, and quietly but unmistakably engaging. If she achieves all that and sweats the details, her work will be beautiful. If not everyone appreciates this beauty — if not everyone understands web design — then let us not cry for web design, but for those who cannot see. — &lt;a href="http://www.alistapart.com/articles/understandingwebdesign/" title="Understanding Web Design"&gt;Jeffrey Zeldman&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinlayout.html#table" title="Abandoning Table-Driven Layouts"&gt;Abandoning Table-Driven Layouts&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinlayout.html#table" title="Abandoning Table-Driven Layouts"&gt;Abandoning Table-Driven Layouts&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinlayout.html#" title="#"&gt;#&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinlayout.html#" title="#"&gt;#&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinlayout.html#" title="#"&gt;#&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;There are a blue million ways to lay out a Web site, from extremely simple to incredibly complex. If you search Google with the terms "CSS layout," you'll see what I mean. But before we go forward, let's take a look at what designers used to do in the wild, wooly, and semantically inaccurate days of yore.&lt;/p&gt;
						
						&lt;p&gt;&lt;strong&gt;Abandoning Table-Driven Layouts&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;When I began fiddling about with Web design in 1998 (strictly as a hobby — I've only begun to get serious about Web design since around 2008), every page layout that wasn't simply "stacked content" (a single full-page column with one element "stacked" one on top of the other like pancakes) was designed with &lt;em&gt;tables&lt;/em&gt;.&lt;/p&gt;
						&lt;p&gt;Tables are wonderful things, for presenting tabular data. But early on in the game (pre-CSS), designers discovered that with some ingenuity, they could use tables to lay out their pages. It's only been since 2007 or thereabouts that something of a consensus has been reached: CSS-driven (tableless) layouts are &lt;span&gt;best practices&lt;/span&gt;, and using tables to create page layouts is just flat wrong.&lt;/p&gt;
						&lt;p&gt;In 2005, when the debate between CSS and table-driven layouts was raging, Web designer Jon Henshaw &lt;a href="http://raventools.com/blog/2585/going-tableless-why-css-should-be-used-for-layouts" title="Going Tableless Why CSS Should Be Used For Layouts"&gt;explained:&lt;/a&gt;&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Tables were never intended by the creators of HTML to control the visual style of a web page. They were only meant to display data with columns and rows. There wasn't a mechanism in place to address the needs of more advanced layouts, so some ingenious web designers discovered that they could use tables to implement robust layouts. Since that time, web designers have been regularly misusing the HTML language, mainly out of necessity.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;In 2008, the tutorial site &lt;a href="http://www.learnwebdesignonline.com/roadmap/html-css/table-based-vs-css-tableless-layout" title="Learn Web Design Online"&gt;Learn Web Design Online&lt;/a&gt; wrote:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Now in 2008, the debate is more of historical interest, since it is clear that the web industry had gone in the direction of CSS-based tableless design. This is evidenced in the past years by many major websites doing an entire sitewide redesign to recode their table-based layouts to tableless layouts. If you pick up HTML/CSS books that are published in 2007 and 2008, you will find that it is CSS-based tableless design is what they will teach you.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;The same site, in a page titled &lt;a href="http://www.learnwebdesignonline.com/roadmap/css/benefits-tableless-layout" title="Benefits of using CSS based Tableless Layouts"&gt;Benefits of using CSS based Tableless Layouts&lt;/a&gt;, gives a number of reasons why CSS-driven layouts are superior to obsolete table-based layouts. Three years before, Henshaw made many of the same observations; Web designer Cameron Olthius &lt;a href="http://www.cameronolthuis.com/2006/04/benefits-of-css/" title="Benefits of CSS"&gt;wrote on the same topic in 2006&lt;/a&gt;. To sum up their arguments, CSS-driven layouts are standards-driven; cleaner; far easier to maintain; more accessible to disabled users; easier for search engines to catalog; perform better; give a multitude of opportunities for creative expression; and are semantically more accurate.&lt;/p&gt;
						&lt;p&gt;On their side of the argument, advocates for table-driven layouts contend that tables are much more intuitive and easier to understand than CSS layouts; CSS layouts are subject to a number of "bugs" that tables don't fall prey to; and have some advantages, such as equal heights for columns, that CSS layouts do not have without "hacks" or workarounds.&lt;/p&gt;
						&lt;p&gt;Henshaw concluded in 2005:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;The main argument for still using tables today stems from bad habits, and complacency. What is often said is that using tables is easier, and that browsers don't support it. It can certainly be easier in some cases, but browsers do support it. Internet Explorer can be frustrating to design for, because it doesn't adhere to web standards very well, but there are many fixes and workarounds that will enable CSS based layouts to render correctly. If there was ever a time to start designing tableless layouts, it's now.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Henshaw wrote his article months before Internet Explorer 7 came out. With all of that browser's flaws and quirks, it supports CSS-driven layouts much, much better than its persnickety predecessor, IE6.&lt;/p&gt;
						&lt;p&gt;More bluntly, Olthius wrote:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt; It's my belief that if you're a professional web designer (in other words, you exchange money for your services) then you should be building sites strictly with CSS.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;In my view, Olthius is spot on. I can't imagine anyone, professional or amateur, who claims to adhere to anything approaching modern design practices advocating anything except tableless, CSS-driven layout design.&lt;/p&gt;
						&lt;p&gt;So why spend so much time and bandwidth on the subject? Because the subject is still being debated, and Web designers who ought to know better have stubbornly continued to advocate for table-driven Web design. You will run into knowledgeable people who strongly advocate tables for Web layouts. I appreciate their determination and their passion, but they are simply wrong. If you intend to design according to &lt;span&gt;best practices&lt;/span&gt;, then you design using CSS to handle your layouts.&lt;/p&gt;
						&lt;p&gt;In the interest of completeness, I should mention an effort, led by some of the best minds at SitePoint and other design organizations, to use "CSS tables" to create layouts. SitePoint founder Kevin Yank &lt;a href="http://www.sitepoint.com/blogs/2008/02/28/table-based-layout-is-the-next-big-thing/" title="Table-Based Layout Is The Next Big Thing"&gt;&lt;/a&gt; wrote about this in 2008, and SitePoint published a controversial book, &lt;a href="http://www.sitepoint.com/books/csswrong1/" title="Everything You Know About CSS Is Wrong"&gt;Everything You Know About CSS Is Wrong!&lt;/a&gt; co-authored by Yank and Web design guru Rachel Andrew, strongly advocating for the use of CSS tables for laying out pages. Unfortunately, since IE7 and earlier iterations of that browser do not support CSS tables whatsoever, it is impossible to use such techniques to design pages for anything approaching a general audience. IE6 has been around since 2001, and almost all designers must create their pages with that browser in mind. Who knows how long it will take for IE7 to run its course and disappear? Until then, learning how to code with CSS tables is little more than an academic exercise. (In light of the new layout techniques that will, we are told, be included in CSS3 when it is released and when browsers begin supporting it, we may never use CSS tables to create layouts.)&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt; ... more coming ...&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194802571"><id gr:original-id="">tag:google.com,2005:reader/item/3f776d70dce35f55</id><title type="html">Positioning Elements » Best Practices HTML and CSS</title><published>2010-05-30T04:46:42Z</published><updated>2010-05-30T04:46:42Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Positioning Elements&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/pragueclock.jpg" alt="Astronomical clock in Prague" title="Astronomical clock in Prague"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;Positioning elements for page layouts.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;

						&lt;blockquote&gt;&lt;p&gt;Position is nine-tenths of the law. — Maggie Tuck&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html#box" title="The Box Model"&gt;The Box Model&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html#basics" title="The Basics of Positioning"&gt;The Basics of Positioning&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html#set" title="Setting the Position Property"&gt;Setting the Position Property&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html#static" title="Static Positioning"&gt;Static Positioning&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html#relative" title="Relative Positioning"&gt;Relative Positioning&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html#absolute" title="Absolute Positioning"&gt;Absolute Positioning&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html#fixed" title="Fixed Positioning"&gt;Fixed Positioning&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html#final" title="Final Thoughts"&gt;Final Thoughts&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;Positioning elements in an HTML page is usually done through the CSS stylesheet. There is some argument over how semantically correct this is, since CSS is supposed to be about a page's style and appearance, and HTML is about content and structure, but I'm not going to rehash that argument here. Suffice it to say that when you consider the issue, it's plain (to me) that CSS is the right venue to handle positioning. You are free to disagree.&lt;/p&gt;
						&lt;p&gt;The key to understanding positioning is understanding the &lt;em&gt;box model&lt;/em&gt; of Web design layout. We touched on the concept in another page:&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html" title="Block and Inline Elements"&gt;More about &lt;em&gt;block and inline elements&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;If you haven't read the page above, you might go back and look it over before moving forward on this page.&lt;/p&gt;
						&lt;p&gt;Much of the information on this page comes from two excellent books by &lt;a href="http://www.sitepoint.com/books/html2/" title="Build Your Own Web Site The Right Way"&gt;Ian Lloyd&lt;/a&gt; and &lt;a href="http://www.amazon.com/Essential-Guide-HTML-Design-Essentials/dp/1590599071/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1274231475&amp;amp;sr=1-1" title="The Essential Guide to CSS&#xD;
and HTML Web Design"&gt;Craig Grannell&lt;/a&gt;, and from several well-regarded Internet sources: &lt;a href="http://www.digital-web.com/articles/web_design_101_positioning/" title="Web Design 101 Positioning"&gt;Tommy Olsson&lt;/a&gt;, &lt;a href="http://www.brainjar.com/css/positioning/default.asp" title="CSS Positioning"&gt;Mike Hall&lt;/a&gt;, &lt;a href="http://www.vanseodesign.com/css/css-positioning/" title="How Well Do You Understand CSS Positioning?"&gt;Steven Bradley&lt;/a&gt;, and &lt;a href="http://www.barelyfitz.com/screencast/html-training/css/positioning/" title="Learn CSS Positioning in Ten Steps"&gt;BarelyFitz Designs&lt;/a&gt;. As always, the sources contain far more information that I have included here. You should definitely check them out on your own.&lt;/p&gt;
						&lt;p&gt;Steven Bradley notes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;When people are new to CSS layouts there’s a tendency to gravitate toward positioning. Positioning seems like an easy concept to grasp. On the surface you specify exactly where you want a block to be located and there it sits. Positioning is a little more complicated than it first appears though. There are a few things that can trip up a newbie and a few things to understand before positioning becomes second nature. You can do some great things with positioning, once you develop a deeper understanding of how it works.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Maybe a bit obvious and even trite, but it's true, and therefore worth quoting.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;The Box Model&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;There are a ton of illustrative images on the Net, but I was lucky enough to secure permission to use this one from the owner, &lt;a href="http://geek.focalcurve.com/crashcourse-part2/" title="Web Standards A Crash Course"&gt;Craig Cook&lt;/a&gt;. (Craig's excellent ruminations and lessons on Web design are found in this and other pages of this site as well. He even sent me a better version of the graphic than the one appearing on his site, one I've provided here.)&lt;/p&gt;
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/boxmodel.png" alt="illustrative graphic of the box model" title="illustrative graphic of the box model"&gt;&lt;/div&gt;
						&lt;p&gt;Oooh, it's all three-dimensional and stuff....&lt;/p&gt;
						&lt;p&gt;But what does it really mean? Here's Cook to explain it all:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Working from the outside in and back to front, we have an invisible margin area between the edge of this element and its adjacent elements. Inside the margin, we can apply a background color, and a background image will overlay that. Padding is invisible space between the edge of the box and its contents, and the background will show through the padding area. Overlaying all this is a border, outlining the visible edge of the element.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Steven Bradley gives us the following information:&lt;/p&gt;
						&lt;p&gt;&lt;strong&gt;width of containing block (box)&lt;/strong&gt; = &lt;em&gt;margin-left&lt;/em&gt; + &lt;em&gt;border-left-width&lt;/em&gt; + &lt;em&gt;padding-left&lt;/em&gt; + &lt;em&gt;width&lt;/em&gt; + &lt;em&gt;padding-right&lt;/em&gt; + &lt;em&gt;border-right-width&lt;/em&gt; + &lt;em&gt;margin-right&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;&lt;strong&gt;height of containing block (box)&lt;/strong&gt; = &lt;em&gt;margin-top&lt;/em&gt; + &lt;em&gt;border-top-width&lt;/em&gt; + &lt;em&gt;padding-top&lt;/em&gt; + &lt;em&gt;height&lt;/em&gt; + &lt;em&gt;padding-bottom&lt;/em&gt; + &lt;em&gt;border-bottom-width&lt;/em&gt; + &lt;em&gt;margin-bottom&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmargins.html" title="Web Design Principles Margins and Padding"&gt;More about &lt;em&gt;margins and padding&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinborders.html" title="Web Design Principles Borders"&gt;More about &lt;em&gt;borders&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;And Mike Hall gives us some more clarification:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Margins, borders and padding are all optional but for purposes of calculating positions and sizes they are given a default width of zero if not specified. Different widths can be set for each individual side (top, right, bottom and left) if desired. Margins can even have negative values. The width and height of each box is equal to the width and height of the outer margin box. Note that this is not the necessarily the same as the width and height of the content area. A box can contain any number of other boxes, creating a hierarchy of boxes that corresponds to the nesting of page elements. The browser window serves as the root element for this hierarchy.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Basically, every element in your stylesheet is, in your HTML page, surrounded by a box. The dimensions are set depending on the content and the characteristics of the element. We can use the &lt;em&gt;width&lt;/em&gt; and &lt;em&gt;height&lt;/em&gt; properties in our CSS markup to define the box boundaries in specific manners.&lt;/p&gt;
						&lt;p&gt;There are two main types of boxes, &lt;em&gt;block&lt;/em&gt; and &lt;em&gt;inline&lt;/em&gt;.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html" title="Web Design Principles Block and Inline Elements"&gt;More about &lt;em&gt;block and inline elements&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Bradley writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Block level boxes are laid out vertically one after the other. If you have two block level boxes next to each other in your html, the second will sit below the first. Inline boxes on the other hand are laid out horizontally. An inline box will always sit to the right of the box that precedes it, assuming there's enough room in the containing element. Inline boxes will wrap though. They will start to the right of the previous box and fill whatever horizontal space is remaining. They will then wrap to the next line and again move to fill the horizontal space. A block level box would automatically drop to the next line before filling any space.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;You might read Bradley's &lt;a href="http://www.instantshift.com/2009/11/16/css-box-model-the-foundation-for-improving-your-css/" title="CSS Box Model The Foundation For Improving Your CSS"&gt;excellent examination of the box model&lt;/a&gt; — the source of the above quote — for more information.&lt;/p&gt;
						&lt;p&gt;We can use margins and padding to set the width and height of our "box" elements, and we can use borders, background colors, and background images to add visual interest (in technical terms, "spiff it up"). The background colors or images we use will show behind the padding and borders, but not the margins.&lt;/p&gt;
						&lt;p&gt;How do we know the dimensions of a particular box? We can best see that in an example.&lt;/p&gt;
						&lt;p&gt;Let's say we have a &lt;em&gt;div&lt;/em&gt; element that is defined as 100 pixels wide:&lt;/p&gt;
						&lt;pre&gt;.example {
   width: 100px;
}&lt;/pre&gt;
						&lt;p&gt;We can add 10 pixels of padding to the box if we like, and even a 5px border:&lt;/p&gt;
						&lt;pre&gt;.example {
   width: 100px;
   padding: 10px;
   border: 5px solid black;
}&lt;/pre&gt;
						&lt;p&gt;The total width of the &lt;code&gt;.example&lt;/code&gt; element is 130 pixels. Howzat? Simple math.&lt;/p&gt;
						&lt;p&gt;5px + 10px + 100px + 10px + 5px = 130px&lt;/p&gt;
						&lt;p&gt;The borders on each side (left and right) are 5px apiece. The padding on each side is 10px apiece. The central element is 100px. Total that on your calculator or in your head and you get 130px.&lt;/p&gt;
						&lt;p&gt;Why is that important? Well, if you use a background image that is 115px wide, you'll see quickly enough that the dimensions of the &lt;code&gt;.example&lt;/code&gt; element have 15px that aren't filled by the image. That won't look right.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Collapsing Margins&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Sometimes, margins between two box elements "collapse," resulting in the larger of the two margins being used and the other one "collapsing" to a de facto value of zero. Very uncool.&lt;/p&gt;
						&lt;p&gt;I'm not going to go into this little problem, but I'll give you a link to an excellent &lt;a href="http://reference.sitepoint.com/css/collapsingmargins" title="Collapsing Margins"&gt;reference article by Tommy Olsson and Paul O'Brien&lt;/a&gt; that will tell you what you need to know, including how to keep it from happening.&lt;/p&gt;

						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;The Basics of Positioning&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;There are four types of positioning in CSS:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;static;&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;relative;&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;absolute;&lt;/em&gt; and&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;fixed&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
						&lt;p&gt;Or in CSS code terms:&lt;/p&gt;
						&lt;pre&gt;position: static;

position: relative;

position: absolute;

position: fixed;&lt;/pre&gt; 
						&lt;p&gt;That's all well and good, but what do the terms mean? And just as importantly, what do they do, and how can I use them effectively in my designs?&lt;/p&gt;
						&lt;p&gt;Well, the terms are confusing. As my friend Tommy Olsson writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Most of us probably regard this matter from a layout point of view, from which the names seem quite odd. A static element isn't static at all, it moves around as we scroll the page. A relatively positioned element is only relative to itself. An absolutely positioned element is not absolute, but relative to some other element. And a fixed element is both absolute and static.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;But the &lt;span title="World Wide Web Consortium"&gt;W3C&lt;/span&gt; didn't assign these names from a layout perspective. The folks in that group assigned these names from a "document" perspective.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinhtml.html" title="Web Design Principles HTML"&gt;More about &lt;em&gt;documents and tags&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Within the HTML document, a static element is "static" — unmoving — within the document flow. A relatively positioned element is "relative" — to itself. An absolutely positioned element is indeed positioned "absolutely" within its container and removed from the document flow. And a fixed element is "fixed" with respect to the document flow.&lt;/p&gt;
						&lt;p&gt;By helping you understand the different kinds of positioning, I can help you make informed and proper decisions as to when to use static, relative, absolute, and fixed positioning in your designs.&lt;/p&gt;
						&lt;p&gt;So let's figure them out. But we won't start by defining the four positioning states, not just yet.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Setting the Position Property&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;CSS gives us the position property as shown above. It also gives us the &lt;em&gt;inherit&lt;/em&gt; value:&lt;/p&gt;
						&lt;pre&gt;position: inherit;&lt;/pre&gt;
						&lt;p&gt;Descendant elements — those coming below the positioning rule or selector in the stylesheet — do not &lt;em&gt;inherit&lt;/em&gt; that positioning, but &lt;code&gt;position: inherit&lt;/code&gt; forces inheritance.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princsssel.html" title="Web Design Principles CSS Selectors, Properties, and Values"&gt;More about &lt;em&gt;CSS selectors, properties, and values&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prininherit.html" title="Web Design Principles Inheritance"&gt;More about &lt;em&gt;inheritance&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Any HTML element can be positioned, including all block and inline elements.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html" title="Web Design Principles Block and Inline"&gt;More about &lt;em&gt;block and inline&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Position properties can also be modified with the following properties:&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;&lt;em&gt;top&lt;/em&gt;&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;right&lt;/em&gt;&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;bottom&lt;/em&gt;&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;left&lt;/em&gt;&lt;/li&gt;
						&lt;/ul&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Static Positioning&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;The &lt;em&gt;static&lt;/em&gt; positioning value is the "default" value for every HTML element. If you don't give an element a different positioning value, it will be positioned as a static element. You won't use &lt;code&gt;position: static&lt;/code&gt; very often, except to undo an earlier positioning rule. A (bad) example:&lt;/p&gt;
						&lt;pre&gt;body {
   position: absolute;
}

#footer {
   position: static;
}&lt;/pre&gt;
						&lt;p&gt;As unlikely (and insane!) as it would be to position everything in your &lt;code&gt;body&lt;/code&gt; as &lt;em&gt;absolute&lt;/em&gt;, this example serves a purpose: to show you how you would make your &lt;code&gt;#footer&lt;/code&gt; revert to the default &lt;em&gt;static&lt;/em&gt; status.&lt;/p&gt;
						&lt;p&gt;Statically positioned elements appear in your displayed page based on whatever statically positioned content appeared before them. Modified by margins and padding, the elements still stay in place with respect to the other content. If you don't change anything's positioning, you often end up with a single "stack" of static content, like a big stack of flapjacks, posed one on top of the other in a big, boring vertical column.&lt;/p&gt;
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/pancakes.jpg" alt="illustrative graphic of a stack of pancakes" title="illustrative graphic of a stack of pancakes"&gt;&lt;/div&gt;
						&lt;p&gt;Okay, maybe less boring and a bit tempting....&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Relative Positioning&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Like most things worth doing, relative positioning takes some thought and effort to grasp properly. Relatively positioned elements are positioned in relation to &lt;em&gt;itself&lt;/em&gt;. Say what?&lt;/p&gt;
						&lt;p&gt;Okay, we'll let Tommy explain it, in what he calls "layman's terms."&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;The box generated by the element is laid out just as it is for static elements. Then the rendered box is shifted horizontally and/or vertically, according to the values of the top, right, bottom, and left properties. But here's the tricky part — as far as the rest of the document is concerned, the box is still in its original place! It is laid out where it should be, and it will occupy that position in the document flow. It's only the rendered box that is shifted, relative to that original position. If we move it a large distance, we will leave a hole in the document.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Since this is the case (and it is, as counter-intuitive or just plain confusing as it may seem), we can't use &lt;code&gt;position: relative&lt;/code&gt; for columnar layouts. And if used in its simplest form, it will merely move elements around a few pixels. So, useless, right? Not at all. It has a side effect that clever Web designers have long used to their advantage.&lt;/p&gt;
						&lt;p&gt;Remember those &lt;em&gt;top, right, bottom,&lt;/em&gt; and &lt;em&gt;left&lt;/em&gt; properties? These "push" the selected element (think boxes, remember) out of its original, &lt;em&gt;static&lt;/em&gt; position. How so?&lt;/p&gt;
						&lt;p&gt;Setting a relatively positioned element 20 pixels from the top:&lt;/p&gt;
						&lt;pre&gt;#element {
   position: relative;
   top: 20px;
}&lt;/pre&gt;
						&lt;p&gt;moves the "box" 20 pixels down from where it would have been had we not futzed with the positioning.&lt;/p&gt;
						&lt;p&gt;(Since we can use &lt;em&gt;negative&lt;/em&gt; values, we could achieve the same effect with this:&lt;/p&gt;
						&lt;pre&gt;#element {
   position: relative;
   bottom: -20px;
}&lt;/pre&gt;
						&lt;p&gt;although we don't usually do it this way — it's just needlessly complex more often than not.&lt;/p&gt;
						&lt;p&gt;Top and bottom positioning cancel each other out, as do left and right positioning. They don't work together. However, top and left, top and right, bottom and left, or bottom and right, work beautifully together.&lt;/p&gt;
						&lt;p&gt;This code:&lt;/p&gt;
						&lt;pre&gt;#element {
   position: relative;
   top: 20px;
   left: 60px;
}&lt;/pre&gt;
						&lt;p&gt;positions the specified element 20 pixels from the top and 60 pixels from the left (or 20 pixels towards the bottom and 60 pixels to the right, if you prefer).&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Absolute Positioning&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Tommy Olsson writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;An element with &lt;code&gt;position:absolute&lt;/code&gt; is removed from the document flow, which means the rest of the document acts as if the element weren't there. It won't affect subsequent elements. Instead, it could end up layered over other elements, unless we make sure it doesn't.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;This is a key to remembering the uses, and pitfalls, of absolutely positioned elements. Many, many Web designers, including sophisticated professionals, routinely rely on absolute positioning for, well, darn near everything. And many times, it gives them what they want. You can position elements precisely where you want them, with pixel-perfect precision. You can even lay out columns. However, absolute positioning has some major drawbacks.&lt;/p&gt;
						&lt;p&gt;Any absolutely positioned element is &lt;em&gt;removed from the document flow&lt;/em&gt;. The rest of the page ignores the absolutely positioned element and goes about its business presenting its content as if the absolutely positioned element doesn't exist. The absolutely posotioned element can, and so often will, end up sitting on top of another portion of the document, layered over other elements as Tommy writes. There are times when we want this to happen, but more often it isn't the effect we want.&lt;/p&gt;
						&lt;p&gt;Or even more maddeningly, you get your page positioned perfectly with one or more absolutely positioned elements. Looks great. Then you change the screen resolution, and everything goes to pot. The relative and statically positioned elements adapt to the new resolution, but the absolutely positioned elements ... don't.&lt;/p&gt;
						&lt;p&gt;Steven Bradley writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;The key to understanding absolute positioning is understanding where the origin is. If top is set to 20px the question you should be asking is 20px from where.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;We can still use the &lt;em&gt;top, right, bottom,&lt;/em&gt; and &lt;em&gt;left&lt;/em&gt; properties, but in a much different way than they function in a relatively positioned element. The four properties now specify the positions of the four edges of the absolutely positioned "box" element. You can use pixels or ems (or other, less used) units of length to specify the values of these properties. You can even use percentages, but that's complicated — percent values for top and bottom refer to a percentage of the height of the &lt;em&gt;containing block&lt;/em&gt;, while for right and left it refers to the width of the &lt;em&gt;containing block&lt;/em&gt;.&lt;/p&gt;
						&lt;p&gt;In fact, the whole idea of absolute positioning is made even more complicated by the concept of the &lt;em&gt;containing block&lt;/em&gt;. Hitch up your pantaloons and get ready for a ride....&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;The Containing Block&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;The concept of the &lt;em&gt;containing block&lt;/em&gt; applies to more than just absolutely positioned elements, but it's a key concept in working with absolute positioning, so we'll tackle it right here. Tommy quotes the &lt;a href="http://www.w3.org/TR/CSS2/" title="Cascading Style Sheets Level 2 Revision 1 Specification"&gt;CSS 2.1 specification&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;If the element has "position: absolute", the containing block is established by the nearest ancestor with a "position" of "absolute", "relative" or "fixed" ... If there is no such ancestor, the containing block is the initial containing block.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;What in the heck does that mean? What's my ancestors have to do with anything? Granny, are you controlling my Web page?&lt;/p&gt;
						&lt;p&gt;Thankfully, Granny isn't involved in this.&lt;/p&gt;
						&lt;p&gt;The &lt;em&gt;containing block&lt;/em&gt; for an absolutely positioned element is its nearest positioned "ancestor" element, say, a &lt;code&gt;#body&lt;/code&gt; or a &lt;code&gt;#div&lt;/code&gt; that has a position selector attached to it. If none exist, the &lt;em&gt;containing block&lt;/em&gt; is, essentially, the &lt;code&gt;html&lt;/code&gt; element. Tommy writes, succinctly enough:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;In other words, we can assume that if there is no positioned ancestor for an absolutely positioned element, the containing block is the document itself.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Here's a quick example:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div class=&amp;quot;whatever&amp;quot;&amp;gt;
   &amp;lt;p&amp;gt;Some content.&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;The &lt;code&gt;#whatever&lt;/code&gt; div creates a &lt;em&gt;containing block&lt;/em&gt; for the paragraph. In its turn, the &lt;code&gt;p&lt;/code&gt; element creates a containing block for the text "Some content".&lt;/p&gt;						
						&lt;p&gt;One of the cool effects of the &lt;em&gt;containing block&lt;/em&gt; paradigm is that when a &lt;em&gt;relatively positioned&lt;/em&gt; element can become the &lt;em&gt;containing block&lt;/em&gt; for an absolutely positioned element. In that case, we can exert control over the containing block.&lt;/p&gt;
						&lt;p&gt;When an "ancestor" element is positioned relatively, we can position an element occurring after that element absolutely. The &lt;em&gt;containing block&lt;/em&gt; doesn't move with the &lt;code&gt;position: relative&lt;/code&gt; affixed to it, it just allows us to control its "descendant" element's absolute positioning. Now we can use the top, right, bottom, and left properties to adjust the element within the corresponding edge of the containing block. This:&lt;/p&gt;
						&lt;pre&gt;left: 10px;&lt;/pre&gt;
						&lt;p&gt;has the left-hand edge of the absolutely positioned element is located 10 pixels from the left-hand edge of the &lt;em&gt;containing block&lt;/em&gt;.&lt;/p&gt;
						&lt;p&gt;Naturally, Internet Explorer 5 and 6 both choke on this to an extent. Tommy explains:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;In a CSS2-compliant browser, we could specify all four properties to give both the position and the dimensions of our absolutely positioned element. Unfortunately, IE5/6 do not support this, so in the real world, we will often need to specify one vertical position (either top or bottom) and one horizontal position (left or right) and then set the width property and, sometimes, the height property. These bugs also apply to values specified as percents. In IE5/6, they do not apply to the dimensions of the containing block, but of the parent block. As we have seen, those can be two very different things. The percentage bugs are also present in Opera, up to and including version 8. They are fixed in Opera 9.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;I don't worry too much about bugs in obsolete versions of Opera (and Firefox), because their users tend to update their browsers in a very short time after the release of a new version. Internet Explorer users, on the other hand, are stuck with the version of the browser that came with their copy of Windows unless they buy a new computer, upgrade their operating system, or otherwise obtain an upgraded version.&lt;/p&gt;
						&lt;p&gt;It's also worth noting that if you have a &lt;em&gt;block&lt;/em&gt; element relatively positioned, it establishes itself as a new &lt;em&gt;containing block&lt;/em&gt;. Mike Hall writes: " Positioned elements within it will use the 'offset' position of that element as a base for positioning. In other words, the offsets of descendant elements are compounded." If you have an &lt;em&gt;inline&lt;/em&gt; element relatively positioned, it does not establish itself as a new &lt;em&gt;containing block&lt;/em&gt;, but uses the offsets of its own &lt;em&gt;containing block&lt;/em&gt;. Hall again: "If the relatively positioned element is an inline element, its offsets are not combined with the offsets of its positioned descendants. Instead they are based on the same containing block used by the relatively positioned element."&lt;/p&gt;
						&lt;p&gt;One more thing: you have another value for the top, right, bottom, and left properties, called &lt;code&gt;auto&lt;/code&gt;:&lt;/p&gt;
						&lt;pre&gt;left: auto;&lt;/pre&gt;
						&lt;p&gt;This tells the browser to place the absolutely positioned element where it would be placed if it were positioned as a normal, i.e. &lt;em&gt;static&lt;/em&gt;, element. This can be very useful.&lt;/p&gt;
						&lt;p&gt;This is quite confusing; I suggest you follow up by perusing &lt;a href="http://www.digital-web.com/articles/web_design_101_positioning/" title="Web Design 101 Positioning"&gt;Tommy Olsson's article&lt;/a&gt; explaining this in more detail.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Nesting Absolutely Positioned Elements&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;
						&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.sitepoint.com/books/html2/" title="Build Your Own Web Site The Right Way Using HTML and CSS"&gt;Ian Lloyd&lt;/a&gt; gives us a nifty little example of nesting absolutely positioned elements one inside the other.&lt;/p&gt;
						&lt;p&gt;If we start with an absolutely positioned block 200 pixels from the top and 200 pixels from the left:&lt;/p&gt;
						&lt;pre&gt;#redblock {
   position: absolute;
   top: 200px;
   left: 200px;
   background-color: red;
   width: 100px;
   height: 100px;
}&lt;/pre&gt;
						&lt;p&gt;you get, well, a small red box 200 pixels down and in.&lt;/p&gt;
						&lt;p&gt;Here's the HTML code:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div id=&amp;quot;redblock&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;(Notice that the div does not contain any content.)&lt;/p&gt;
						&lt;p&gt;Now, let's say we want a smaller yellow box to appear inside our red box.&lt;/p&gt;
						&lt;p&gt;We might want to put the yellow box 220 pixels down and 220 pixels in. We would be wrong.&lt;/p&gt;
						&lt;p&gt;First, we need to place the div containing the &lt;code&gt;#yellowblock&lt;/code&gt; ID inside of the div containing the &lt;code&gt;#redblock&lt;/code&gt; ID. Like so:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div id=&amp;quot;redblock&amp;quot;&amp;gt;
   &amp;lt;div id=&amp;quot;yellowblock&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;This means that the &lt;code&gt;#yellowblock&lt;/code&gt; div inherits the positioning of its parent element, the &lt;code&gt;#redblock&lt;/code&gt; div.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prininherit.html" title="Web Design Principles Inheritance"&gt;More about &lt;em&gt;inheritance&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Now, to make this work, we create the &lt;code&gt;#yellowblock&lt;/code&gt; CSS. We'll place the yellow box 20 pixels down and 20 pixels in from the top left point of the red box, and make it half the width of the red box:&lt;/p&gt;				
						&lt;pre&gt;#yellowblock {
   position: absolute;
   top: 20px;
   left: 20px;
   background-color: yellow;
   color: red;
   width: 50px;
   height: 50px;
   padding: 5px;
}&lt;/pre&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/examplefiles/exap.html" title="example of nested absolutely positioned elements"&gt;Here's what Ian's nested elements look like&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Nifty, huh? Ian Lloyd has given us a great visual example of how absolutely positioned elements can work in concert with one another.&lt;/p&gt;
						&lt;p&gt;You might want to play with the code a bit in your own page (or just copy and paste the source code of the example page into a blank HTML file). Try making the &lt;code&gt;#yellowbox&lt;/code&gt; width and height 100px. Try changing the positioning. Have some fun with it.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Fixed Positioning&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;If you have figured out absolute positioning, you pretty much understand &lt;em&gt;fixed positioning.&lt;/em&gt; (Mike Hall actually classifies fixed positioning as a variant of absolute positioning.) The biggest difference is that for an element with fixed positioning, the &lt;em&gt;containing block&lt;/em&gt; is &lt;em&gt;always&lt;/em&gt; the initial containing block — generally, the &lt;code&gt;html&lt;/code&gt; element that defines the entire HTML document. The top, right, bottom, and left properties always reference the edges of the browser window, or if you're creating a print stylesheet, the paper.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html#print" title="Web Design Principles Creating Print Stylesheets"&gt;More about &lt;em&gt;print stylesheets&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Elements with fixed positioning don't move. Period. If you've seen pages with fixed navigation schemes, for example (&lt;a href="http://www.sohtanaka.com/web-design/examples/sticky-nav/" title="fixed nav example"&gt;here's a demo of one&lt;/a&gt; from CSS guru Soh Tanaka, and &lt;a href="http://designm.ag/tutorials/sticky-sidenav-layout/" title="Sticky (Fixed) SideNav Layout with CSS"&gt;here's the main page for that demo&lt;/a&gt;), they use fixed positioning to make it all happen.&lt;/p&gt;
						&lt;p&gt;Naturally, Internet Explorer 5/6 poses a problem with using &lt;code&gt;position: fixed;&lt;/code&gt;. Neither browser recognizes the selector at all. That's why you rarely see designers using this one.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;The Z-Index&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Whether you're using relative, absolute, or fixed positioning, it's entirely possible that you have "boxes" on top of one another to one extent or the other: overlap. If we want to control which box is on "top" in our display, we can use the &lt;em&gt;z-index&lt;/em&gt; property.&lt;/p&gt;
						&lt;p&gt;(This has no effect on elements positioned statically.)&lt;/p&gt;
						&lt;p&gt;The &lt;em&gt;z-index&lt;/em&gt; property is a numeric value, positive or negative. To understand what it does, we have to think in three dimensions for a moment. (You might jump up to &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinposition.html#boxmodel"&gt;Craig Cook's nifty illustration of the box model&lt;/a&gt; for a visual reminder of how this works.)&lt;/p&gt;
						&lt;p&gt;I'm going to let Tommy explain this again, since his understanding of the property is much deeper than mine:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;A computer screen is (currently) two-dimensional. It's a flat area with a width and a height, onto which we can render our CSS boxes. But CSS actually works in three dimensions. The X and Y axes are our normal horizontal and vertical axes, respectively. The Z axis is perpendicular to those two. Think of it as pointing straight into the front of and out the back of the screen. The higher the value of the z-index property, the closer the element is to the user. This is called the &lt;em&gt;stacking level&lt;/em&gt;.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Tommy doesn't go into intensive detail about &lt;em&gt;stacking levels&lt;/em&gt; and &lt;em&gt;stacking contexts&lt;/em&gt;, for which we can be grateful, I suppose. A rule of thumb about this is that you can assign a "stacking level" — the order of the stack in three dimensions — using the &lt;em&gt;z-index&lt;/em&gt; property.&lt;/p&gt;
						&lt;p&gt;I'm going to shamelessly steal Tommy's example to illustrate this effect. Given the following HTML code:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div id=&amp;quot;first&amp;quot;&amp;gt;
   &amp;lt;div id=&amp;quot;a&amp;quot;&amp;gt;...&amp;lt;/div&amp;gt;
   &amp;lt;div id=&amp;quot;b&amp;quot;&amp;gt;...&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div id=&amp;quot;next&amp;quot;&amp;gt;
   &amp;lt;div id=&amp;quot;c&amp;quot;&amp;gt;...&amp;lt;/div&amp;gt;
   &amp;lt;div id=&amp;quot;d&amp;quot;&amp;gt;...&amp;lt;div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;and the following CSS rules:&lt;/p&gt;
						&lt;pre&gt;#first {
   position: relative;
}

#next {
   position: relative;
}&lt;/pre&gt;
						&lt;p&gt;Both the &lt;em&gt;first&lt;/em&gt; and &lt;em&gt;next&lt;/em&gt; divs are relatively positioned. Therefore, they are the &lt;em&gt;containing blocks&lt;/em&gt; for any absolutely positioned "children," or "descendent" elements.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prininherit.html#child" title="Web Design Principles Parent-Child Relationships in CSS"&gt;&lt;/a&gt;&lt;/p&gt;
						&lt;p&gt;The inner, "child" divs (&lt;em&gt;a, b, c,&lt;/em&gt; and &lt;em&gt;d&lt;/em&gt;) are relatively positioned. Now we can influence the &lt;em&gt;stacking order&lt;/em&gt; for the four letter divs using the &lt;em&gt;z-index.&lt;/em&gt; Like so:&lt;/p&gt;
						&lt;pre&gt;#a {
   z-index: 4;
}

#b {
   z-index: 3;
}

#c {
   z-index: 2;
}

#d {
   z-index: 1;
}&lt;/pre&gt;
						&lt;p&gt;Since the &lt;em&gt;a&lt;/em&gt; div has the highest (therefore the highest priority) number, it will appear on "top" in the stack. The &lt;em&gt;d&lt;/em&gt; div will be the last, or "bottom" element. The actual numbers used aren't important — you can achieve the same effect by using these values:&lt;/p&gt;
						&lt;pre&gt;#a {
   z-index: 9999;
}

#b {
   z-index: 100
}

#c {
   z-index: 10;
}

#d {
   z-index: 1;
}&lt;/pre&gt;
						&lt;p&gt;Tommy gives some more vital information:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;We can also affect the stacking order of first and next, should they overlap, because they live in the same stacking context. But what if we want next or c to slide in between a and b? Now we’re out of luck, because next and c exist in different stacking contexts from a and b, and there is no way that we can insert them between those two. Likewise, we cannot intersperse child elements of b with child elements of a, because a and b establish their own separate stacking contexts. Just as knowledge of the containing block is extremely important for absolute positioning, the stacking context is important when using z-index.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;If you use negative numbers in your &lt;em&gt;z-index&lt;/em&gt; values, those designated elements will appear behind other elements, whether they bear a positive &lt;em&gt;z-index&lt;/em&gt; value or are undesignated. Some designers like to use this to make sure a particular element is always below everything else:&lt;/p&gt;
						&lt;pre&gt;z-index: -9999;&lt;/pre&gt;
						&lt;p&gt;Web designer Louis Lazaris gives us more info on the &lt;em&gt;z-index&lt;/em&gt; in an &lt;a href="http://www.smashingmagazine.com/2009/09/15/the-z-index-css-property-a-comprehensive-look/" title="The Z-Index CSS Property A Comprehensive Look"&gt;informative Smashing Magazine article&lt;/a&gt;, including a look at the use of &lt;em&gt;z-index&lt;/em&gt; with JavaScript, implementation problems with IE and Firefox, and an array of varied elements and creations that hinge on the use of the &lt;em&gt;z-index&lt;/em&gt; property.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Tommy has provided us an excellent &lt;a href="http://www.digital-web.com/extras/positioning_101/css_positioning_example.php" title="CSS Positioning Example Page"&gt;example page&lt;/a&gt; showing all of the positioning schemes employed in the same document. IE 5/6 users will not see it properly, because those browsers are broken. Mike Hall has also provided some &lt;a href="http://www.brainjar.com/css/positioning/default.asp" title="CSS Positioning"&gt;nifty examples&lt;/a&gt;.&lt;/p&gt;						
						
						&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194735694"><id gr:original-id="">tag:google.com,2005:reader/item/34eb5d086607d7e3</id><title type="html">Classes and IDs » Best Practices HTML and CSS</title><published>2010-05-30T04:45:35Z</published><updated>2010-05-30T04:45:35Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Classes and IDs&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/idtag.jpg" alt="ID tag" title="ID tag"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;Classes and IDs, the similarities and differences.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;Placeholder for pithy quote.&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html#diff" title="The Difference between Classes and IDs"&gt;Class, ID Differences&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html#limit" title="Limiting Classes to Specific Elements"&gt;Classes &amp;amp; Specific Elements&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html#semantic" title="Using Classes and IDs Semantically"&gt;Using Classes &amp;amp; IDs Semantically&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;We use &lt;code&gt;classes&lt;/code&gt; and &lt;code&gt;IDs&lt;/code&gt; to hang specific modifications from in our stylesheets.&lt;/p&gt;
						&lt;p&gt;What exactly does that mean?&lt;/p&gt;
						&lt;p&gt;In and of themselves, &lt;code&gt;classes&lt;/code&gt; and &lt;code&gt;IDs&lt;/code&gt; do nothing. It's what we do with them that counts. We "hook" things to them.&lt;/p&gt;
						&lt;p&gt;The folks at &lt;a href="http://css-discuss.incutio.com/wiki/Classes_Vs_Ids" title="Classes Vs Ids"&gt;CSS-Discuss note&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Classes are useful to apply similar declarations to a variety of elements. In design, you often want thematic style to be applied consistently. For example, you may wish for all external links to be red, while internal links are blue. Using the class attribute in this case makes sense. IDs are useful to uniquely identify a particular element. On the face of it, this may seem to be a narrow use, but if you consider that a Contextual Selector [&lt;strong&gt;see below&lt;/strong&gt;] can be used to apply declarations to elements which are contained by a particularly ID'ed element, the usefulness is greater. For example, you may wish to have all menu links be green, while content links are red. Placing the menu inside an element which is ID'd as "menu" or "content" respectively allows you to make contextual styling based on the section of the page.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Wow, that was confusing. Accurate, but confusing (and when you get this concept figured out, you'll reread this quote and agree with it completely).&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://css-tricks.com/the-difference-between-id-and-class/" title="The Difference Between ID and Class"&gt;Chris Coyier writes&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;We need ways to describe content in an HTML/XHTML document. The basic elements like &amp;lt;h1&amp;gt;, &amp;lt;p&amp;gt; and &amp;lt;ul&amp;gt; will often do the job, but our basic set of tags doesn&amp;#39;t cover every possible type of page element or layout choice. For this we need ID&amp;#39;s and Classes. For example &amp;lt;ul id=&amp;quot;nav&amp;quot;&amp;gt;, this will give us the chance to target this unordered list specifically, so that we may manipulate it uniquely to other unordered lists on our page. Or we might have a section on our page that has no relevant tag to signify it, for example a footer, where we might do something like this: &amp;lt;div id=&amp;quot;footer&amp;quot;&amp;gt;. Or perhaps we have boxes in our sidebar for keeping content over there separated in some way: &amp;lt;div class=&amp;quot;sidebar-box&amp;quot;&amp;gt;.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Did that help you or confuse you? Maybe a little of both?&lt;/p&gt;
						&lt;p&gt;That's partly because Chris is talking about using &lt;code&gt;classes&lt;/code&gt; and &lt;code&gt;IDs&lt;/code&gt; for layout purposes, something you may not have gotten to yet.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html#nogo" title="coming soon"&gt;More about &lt;em&gt;layouts&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;In the stylesheet, &lt;code&gt;classes&lt;/code&gt; and &lt;code&gt;IDs&lt;/code&gt; can either stand alone or go with an HTML element:&lt;/p&gt;
						&lt;p&gt;either&lt;/p&gt;
						&lt;pre&gt;.bigfont {
   font-size: 4em;
}&lt;/pre&gt;
						&lt;p&gt;or&lt;/p&gt;
						&lt;pre&gt;p.bigfont {
   font-size: 4em;
}&lt;/pre&gt;
						&lt;p&gt;Notice that the class is designated by the period in front of the class name: &lt;code&gt;.bigfont&lt;/code&gt;. Just the word "bigfont" by itself would mean nothing in your stylesheet.&lt;/p&gt;
						&lt;p&gt;Both of these examples make a pretty huge font when applied to a specific chunk of code. The first class, &lt;code&gt;bigfont&lt;/code&gt;, can be applied to anything: an unordered list, a blockquote, a header, whatever. It's what the code warriors call "an implied universal selector," applying to anything you like. The second, &lt;code&gt;bigfont p&lt;/code&gt;, will only work if applied to a paragraph (&lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;).&lt;/p&gt;
						&lt;p&gt;Here's how either of them would work in your HTML page:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;p class=&amp;quot;bigfont&amp;quot;&amp;gt;text to be enlarged&amp;lt;/p&amp;gt;&lt;/pre&gt;
						&lt;p&gt;Only the text in the paragraph classed &lt;code&gt;bigfont&lt;/code&gt; would be enlarged.&lt;/p&gt;
						&lt;p&gt;You can even use multiple classes in a single CSS element. Here's an example suggested by Olsson and O'Brien, and modified by me:&lt;/p&gt;
						&lt;pre&gt;div.foo.bar {
   font-size: 4em;
}

div.foo.bar[title^="Help"] {
   font-size: 4em;
	color: #ff08ff;
}&lt;/pre&gt;
						&lt;p&gt;In the first selector, the &lt;code&gt;div&lt;/code&gt; labeled with two classes, &lt;code&gt;.foo&lt;/code&gt; and &lt;code&gt;.bar&lt;/code&gt;, would only effect changes on an HTML &lt;code&gt;div&lt;/code&gt; element with both classes incorporated into it:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div class=&amp;quot;foo bar&amp;quot;&amp;gt;Matches 1st example&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;In the second selector, the &lt;code&gt;div&lt;/code&gt; labeled with two classes, &lt;code&gt;.foo&lt;/code&gt; and &lt;code&gt;.bar&lt;/code&gt;, and incorporating the title, &lt;code&gt;Help&lt;/code&gt;, would only effect changes on an HTML &lt;code&gt;div&lt;/code&gt; element with both classes incorporated into it:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div class=&amp;quot;foo bar&amp;quot; title=&amp;quot;Help&amp;quot;&amp;gt;Matches 2nd example&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;&lt;span&gt;Note&lt;/span&gt;: Internet Explorer has some bugaboos with classes. In IE6, the class selector doesn't work if the class name starts with a hyphen (-) or an underscore (_). IE6 and below (IE5.5, for example, which few people bother with designing for, but IE6 is still out there in all its persnickety glory), if you use multiple class selectors (as in our example above), it will only pay attention to the last selector, and will ignore the others. Grr.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;The Difference between Classes and IDs&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;An &lt;code&gt;ID&lt;/code&gt; (short for &lt;strong&gt;id&lt;/strong&gt;entifier), works exactly like a class. Everything written above also applies to IDs.&lt;/p&gt;
						&lt;p&gt;So what's the difference? Actually, some fairly big ones.&lt;/p&gt;
						&lt;p&gt;An &lt;code&gt;ID&lt;/code&gt; is identified by a &lt;code&gt;#&lt;/code&gt; instead of a &lt;code&gt;.&lt;/code&gt;, like so:&lt;/p&gt;
						&lt;pre&gt;#bigfont {
   font-size: 4em;
}&lt;/pre&gt;
						&lt;p&gt;An ID can only be used once per HTML page, where a class can be used over and over again. There's a reason for that: the &lt;code&gt;#&lt;/code&gt; mark is used for internal links, like so:&lt;/p&gt;
						&lt;p&gt;&lt;span&gt;http://www.example.com#comments&lt;/span&gt;&lt;/p&gt;
						&lt;p&gt;The browser goes directly to the element ID'd as "comments".&lt;/p&gt;
						&lt;p&gt;Let's say that again, with feeling:&lt;/p&gt;
						&lt;p&gt;&lt;span&gt;An ID can only be used once per HTML page, where a class can be used over and over again.&lt;/span&gt;&lt;/p&gt;
						&lt;p&gt;If you do repeat an ID in a page, some browsers will be forgiving enough to display it the way you meant it to be seen, but some won't. And it will not pass a validation check.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinvalid.html" title="Web Page Design Validating Pages"&gt;More about &lt;em&gt;validating your pages&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://css-tricks.com/the-difference-between-id-and-class/" title="The Difference Between ID and Class"&gt;Coyier gives us a terrific analogy&lt;/a&gt; about the difference between classes and IDs:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Maybe a good analogy here is bar codes and serial numbers. Take an iPod in a store. On the packaging will be a bar code. This tells the store what the product is, so when it is scanned, the system knows exactly what the product is and what it costs. It might even be able to know what color it is or where it was kept in the store. All iPod of this same type have the exact same bar code on them.&lt;/p&gt;
						&lt;p&gt;The iPod will also have a serial number on it which is absolutely unique to any other iPod (or any other device) in the world. The serial number doesn't know the price. It could, but for the store this wouldn’t be a very efficient way to store and use that data. Much easier to use the barcode, so that for example, if the price changed, you could just change the price for that bar code and not every individual serial number in your system.&lt;/p&gt;
						&lt;p&gt;This is much like ID's and Classes. Information that is reuseable should be kept in a class and information that is totally unique should be kept in an ID.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;You can specify a particular element to be affected with the ID selector:&lt;/p&gt;
						&lt;pre&gt;ul#navigation {
   font-size: 2em;
}&lt;/pre&gt;
						&lt;p&gt;but make sure no whitespace is between the type selector and the ID selector. In other words, this:
						&lt;/p&gt;&lt;pre&gt;ul #navigation { &lt;span&gt;WILL NOT WORK!&lt;/span&gt;
   font-size: 2em;
}&lt;/pre&gt;
						&lt;p&gt;will not work!&lt;/p&gt;
						&lt;p&gt;&lt;span&gt;Note&lt;/span&gt;: Internet Explorer 6 will ignore an ID selector unless it's the last one in the selector; if you put a class after it in a multiple selector, IE6 will not recognize it. Grr again.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Limiting Classes to Specific Elements&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;One thing you can do with a class that you can't do with an ID is to give specific elements with that class particular styling, while not putting that styling on other instances of that class.&lt;/p&gt;
						&lt;p&gt;Say what? Here's an example.&lt;/p&gt;
						&lt;p&gt;Say you've created a class called "critical", used for the most important parts of your text content. You want to style it in a classy serif font, boldface it, increase its size a bit, and expand the letter spacing to set it off just that little bit more:&lt;/p&gt;
						&lt;pre&gt;.critical {
   font-weight: bold;
   font-family: "Palatino Linotype", "Book Antiqua", "Century Schoolbook", Georgia, serif;
   letter-spacing: 0.05em;
}&lt;/pre&gt;
						&lt;p&gt;But, you decide that text inside a &lt;code&gt;blockquote&lt;/code&gt; should be italicized instead of made bold. Easy enough:&lt;/p&gt;
						&lt;pre&gt;blockquote.critical {
   font-weight: normal;
   font-style: italic;
}&lt;/pre&gt;
						&lt;p&gt;Note there is &lt;strong&gt;no space&lt;/strong&gt; between "blockquote" and ".critical."&lt;/p&gt;
						&lt;p&gt;Now, this text:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;blockquote class=&amp;quot;critical&amp;quot;&amp;gt;
   &amp;lt;p&amp;gt;Important text.&amp;lt;/p&amp;gt;
&amp;lt;/blockquote&amp;gt;&lt;/pre&gt;
						&lt;p&gt;will appear in the proper font, with the proper letter-spacing, but italicized instead of in boldface.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.sitepoint.com/books/html2/" title="Build Your Own Web Site The Right Way"&gt;Ian Lloyd&lt;/a&gt; explains it better than I can:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;By prefixing our normal class selector with an element name, we're telling the browser to apply the following declarations to that element-and-class combination only. It's as simple as &lt;code&gt;element.class&lt;/code&gt;, but make sure you don't leave any spaces!&lt;/p&gt;&lt;/blockquote&gt;						
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Using Classes and IDs Semantically&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Coyier &lt;a href="http://css-tricks.com/the-difference-between-id-and-class/" title="The Difference Between ID and Class"&gt;reminds us about using classes and ID semantically&lt;/a&gt;. Instead of paraphrasing, let's just quote him:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Also avoid this:&lt;br&gt;&lt;br&gt;&amp;lt;div id=&amp;quot;right-col&amp;quot;&amp;gt;&lt;br&gt;&lt;br&gt;ID is appropriately used here as the page will likely only have a single right column, but the name is inappropriate. Try and describe the context of the element, not where it is or what it looks like. An ID here of "sidebar" would be more appropriate.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;This is a mistake I commonly make, so don't repeat my blunders.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194708535"><id gr:original-id="">tag:google.com,2005:reader/item/d72402811c75b039</id><title type="html">The Wonderful World of Fonts » Best Practices HTML and CSS</title><published>2010-05-30T04:45:08Z</published><updated>2010-05-30T04:45:08Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;The Wonderful World of Fonts and Typography&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/callasrustica.jpg" alt="ancient Roman typography" title="ancient Roman typography"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;A look at fonts and typography for Web sites.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;Web design is 95% typography. — &lt;a href="http://informationarchitects.jp/the-web-is-all-about-typography-period/" title="Web Design is 95 Percent Typography"&gt;Oliver Reichenstein&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;		

						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html#four" title="The Four Types of Fonts"&gt;The Four Types of Fonts&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html#family" title="Font Stacks Using font-family"&gt;Font Stacks Using &lt;em&gt;font-family&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html#shortcuts" title="Making Font Shortcuts"&gt;Making Font "Shortcuts"&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html#styling" title="Styling Your Fonts"&gt;Styling Your Fonts&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html#a625" title="The 62.5 Method of Sizing Fonts"&gt;The 62.5% Method of Sizing Fonts&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html#read" title="Further Reading"&gt;Further Reading&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;There is a lot more to choosing fonts than merely picking a font you like from Microsoft Word. There are really only a few fonts that work on (almost) all systems, from Windows to Mac and Linux. These are called "web-safe" fonts because you can expect that, when you use them, almost all the people who visit your site will see it in the font you like.&lt;/p&gt;
						&lt;p&gt;If you don't have Microsoft Word on your machine, try using your word processor or text editor to display the fonts. If you don't have one of those, then you'll have to go through your machine's Fonts applet (or your equivalent) to display your fonts. There are also a lot of free font utilities on the Internet to manage and display the fonts on your machine. One simple one I can recommend for Windows users is &lt;a href="http://www.styopkin.com/details_free_and_easy_fonts_viewer.html" title=""&gt;Free &amp;amp; Easy Font Viewer&lt;/a&gt;. A free utility for Mac and Linux users (and Windows, if they choose) is &lt;a href="http://opcion.sourceforge.net/" title="Opcion"&gt;Opcion&lt;/a&gt;.&lt;/p&gt;						
						&lt;p&gt;Here's a list of the "web-safe" fonts, from &lt;a href="http://www.webdesigndev.com/web-development/16-gorgeous-web-safe-fonts-to-use-with-css" title=""&gt;WebDesignDev&lt;/a&gt; and my own &lt;a href="http://articles.sitepoint.com/article/eight-definitive-font-stacks" title="8 Definitive Web Font Stacks"&gt;SitePoint article&lt;/a&gt;. (All the images are public-domain PNGs from Wikimedia.) The fonts in &lt;em&gt;italics&lt;/em&gt; can be found on 95%+ of the computers in existence. The others are on a strong majority of systems, and can be used to base your font-family "font stacks" on as well.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;The Four Types of Fonts&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;&lt;em&gt;Serif Fonts:&lt;/em&gt; Copperplate Gothic Light, &lt;em&gt;Georgia&lt;/em&gt;, Palatino Linotype, &lt;em&gt;Times New Roman (pictured below)&lt;/em&gt;&lt;/p&gt;
						&lt;div&gt;
							&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/fonts/serif.png" title="An example of a serif font" alt="An example of a serif font"&gt;
							&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/fonts/redserif.png" title="Serifs in red" alt="Serifs in red"&gt;
						&lt;/div&gt;
						&lt;p&gt;In the second illustration, the &lt;span title="Serifs are fine lines that finish off the main lines of a character"&gt;serifs&lt;/span&gt; of the font are marked in red.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;&lt;span title="Sans-serifs don&amp;#39;t have serifs on their characters"&gt;Sans-serif&lt;/span&gt; Fonts:&lt;/em&gt; &lt;em&gt;Arial, Arial Black, Arial Narrow&lt;/em&gt;, Century Gothic, Gill Sans, Lucida Sans Unicode, &lt;em&gt;Tahoma, Trebuchet MS, Verdana&lt;/em&gt; (the illustration below depicts Helvetica, a Mac font very similar to Arial)&lt;/p&gt;
						&lt;div&gt;
							&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/fonts/sans-serif.png" title="An example of a sans-serif font" alt="An example of a sans-serif font"&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;&lt;span title="Each letter of a monospace font takes up the precise same width, like a typewriter"&gt;Monospace&lt;/span&gt; Fonts:&lt;/em&gt; Andale Mono, &lt;em&gt;Courier New (pictured below)&lt;/em&gt;, Lucida Console&lt;/p&gt;
						&lt;div&gt;
							&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/fonts/monospace.png" title="An example of a monospace font" alt="An example of a monospace font"&gt;
						&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;&lt;span title="Like cursive handwriting"&gt;Cursive&lt;/span&gt; and &lt;span title="Anything goes, baby!"&gt;Fantasy&lt;/span&gt; Fonts: Comic Sans MS, Impact&lt;/em&gt; (not sure what font is depicted below)&lt;/p&gt;
						&lt;div&gt;
							&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/fonts/fantasy.png" title="An example of a fantasy font" alt="An example of a fantasy font"&gt;
						&lt;/div&gt;
						&lt;p&gt;Only about half of these fonts can reasonably be used to create "font stacks" for your pages, particularly your body text — you don't want to sacrifice readibility for appearance. That's why three relatively boring fonts — Verdana, Arial, and Arial's Mac cousin, Helvetica — are perhaps the most popular body text fonts in use today.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Font Stacks Using&lt;/strong&gt; &lt;em&gt;@font-family&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Creating "families" of fonts in what we call &lt;code&gt;@font-family&lt;/code&gt; groups, after the CSS property, is something designers argue over at length. But, everyone appreciates a starting place.&lt;/p&gt;
						&lt;p&gt;Here are some very simple, basic suggestions for font stacks you might use in your designs. Remember, these are suggestions. Take them, use them, think about them, and change them as needed.&lt;/p&gt;
						&lt;p&gt;The basic formula is simple: Start with a font you like, then give a close alternative that others will see if they don't have the font you like, then give a more universal (web-safe) alternative, and finally end with the generic "serif," "sans-serif," or "monospace" font name. Remember, the universal fonts go at the END of the stack, not the beginning!&lt;/p&gt;
						&lt;p&gt;Notice that all fonts that have more than one word must be enclosed in quotes, with the comma outside the closing quote: for example:&lt;/p&gt;
						&lt;pre&gt;"Times New Roman", serif.&lt;/pre&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;em&gt;Serif Fonts&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;A good serif font stack to start with might be:&lt;/p&gt;
						&lt;pre&gt;font-family {
   Georgia, "Times New Roman", serif;
}&lt;/pre&gt;
						&lt;p&gt;What you're telling the browser: "Use Georgia to display this text. If you don't have Georgia on your machine, use Times New Roman. If you don't have that, either, use whatever default serif font you have."&lt;/p&gt;
						&lt;p&gt;Here's a serif font stack I sometimes use, beginning with a Microsoft Vista font, following with two serifs often used on Linux machines, and finishing with the two universal fonts:&lt;/p&gt;
						&lt;pre&gt;font-family {
   Constantia, "Liberation Serif", "Nimbus Roman No9 L &lt;br&gt;Regular", Georgia, "Times New Roman", serif;
}&lt;/pre&gt;
						&lt;p&gt;Note: Georgia looks better than Times New Roman on the Web, and should be used in preference, i.e. before Times New Roman in your stacks.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;em&gt;Sans-Serif&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;A good sans-serif font stack might be:&lt;/p&gt;
						&lt;pre&gt;font-family {
   Helvetica, Arial, sans-serif;
}&lt;/pre&gt;
						&lt;p&gt;Here's a sans-serif font stack I sometimes use, again beginning with a Microsoft Vista font, following with two sans-serifs often used on Linux machines, continuing with a widely used Mac font, and finishing with the near-universal Arial:&lt;/p&gt;
						&lt;pre&gt;font-family {
   "Segoe UI", "Liberation Sans", "Nimbus Sans L", Helvetica, &lt;br&gt;Arial, serif;
}&lt;/pre&gt;
						&lt;p&gt;Verdana is perhaps the most widely used font on the Internet, because it is so readable and easy on the eye. It's a good bit wider than the relatively narrow Helvetica/Arial combinations. Here's a Verdana-based stack you might consider, starting with a popular Mac font, moving to two Linux fonts, and ending with Verdana:&lt;/p&gt;
						&lt;pre&gt;font-family {
   "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans", &lt;br&gt;Verdana, sans-serif;
}&lt;/pre&gt;
						&lt;p&gt;Many experts believe that sans-serif is a better font choice for large blocks of text (say, paragraphs) that serif. I'll let &lt;a href="http://www.sitepoint.com/books/html2/" title="Build Your Own Web Site The Right Way"&gt;Ian Lloyd&lt;/a&gt; explain:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;A serif font is one that has all those little flourishes at the ends of each letter. These flourishes ... are known as serifs. They're great for reading printed material, as they give a little shape to the words, making them easier to read. However, on the screen, serif fonts can become a little messy, especially when they're used for smaller type — there simply aren't enough pixels on the screen to do these little flourishes justice. For this reason, you’ll notice that many web sites use sans-serif fonts (from French, translating as 'without serif') when the font size is set quite small.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Serif fonts are excellent for headers and blocks of text intended to be displayed in larger sizes, and with fewer words included.&lt;/p&gt;
						&lt;p&gt;Does everyone agree with this? Not at all. For a single example out of many, my friend Vivien, in her site &lt;em&gt;Inspiration Bit&lt;/em&gt;, gives us &lt;a href="http://www.inspirationbit.com/georgia-on-my-mind/" title="Georgia On My Mind"&gt;an excellent compendium of 32 sites designed around the Georgia font&lt;/a&gt;. &lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;em&gt;Monospace Fonts&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Monospace fonts are used primarily for presenting code and other "fixed-width" text. (You're seeing the code on these pages in either Consolas, Andale Mono, Lucida Console, or Courier New, depending on what's on your machine.) A good monospace font stack might be:&lt;/p&gt;
						&lt;pre&gt;font-family {
   "Andale Mono", "Courier New", monospace;
}&lt;/pre&gt;
						&lt;p&gt;Here's a monospace font stack I sometimes use, again beginning with a Microsoft Vista font, following with two sans-serifs often used on Linux machines, and finishing with two web-safe fonts:&lt;/p&gt;
						&lt;pre&gt;font-family {
   Consolas, "Liberation Mono", "Nimbus Mono L", "Andale Mono", &lt;br&gt;"Courier New", monospace;
}&lt;/pre&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;em&gt;Fantasy/Cursive Fonts&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;It's tough to create a fantasy or cursive font stack that will show up on most computers. The only two that are widely used, Impact and Comic Sans MS, are very, very different in appearance; Impact is a heavy, compressed font sometimes used for headers, and Comic Sans MS, created to give the appearance of "comic-book" lettering, has been so terribly &lt;a href="http://www.inspirationbit.com/a-plea-from-16-most-overused-fonts/" title="A Plea From 16 Most Overused Fonts"&gt;overused and misused&lt;/a&gt; that many designers refuse to use it at all.&lt;/p&gt;
						&lt;p&gt;&lt;span&gt;Warning:&lt;/span&gt; A lot of people don't like the Vista fonts (I used Constantia, Segoe UI, and Consolas in my examples). If you find they don't look good in your designs, take them out!&lt;/p&gt;
						&lt;p&gt;A lot of designers like to combine serifs and sans-serifs in their designs. For example, the design for this site uses Georgia, a "universal" serif font, as its base, and a sans-serif, Helvetica Neue, as the font for its central body content. (You're reading this in Helvetica Neue right now, or, if your machine lacks that font, either Helvetica or Arial.) The combination of serifs and sans-serifs seems to work very nicely in most designs.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Making Font "Shortcuts"&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Like some other CSS properties, you can make "shortcuts" out of multiple font properties. For example:&lt;/p&gt;
						&lt;pre&gt;.regtext {
   font-weight: bold;
   font-size: 14px;
   font-family: verdana, arial, sans-serif;
}&lt;/pre&gt;
						&lt;p&gt;can be shortened:&lt;/p&gt;
						&lt;pre&gt;.regtext {
   font: bold 14px verdana, arial, sans-serif;
}&lt;/pre&gt;
						&lt;p&gt;The folks at &lt;a href="http://www.tech-evangelist.com/2008/08/23/css-shortcuts/" title=""&gt;Tech-Evangelist&lt;/a&gt;, whose shortcuts I cribbed, remind us:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Not all related CSS rules can be combined into a shortcut, but many of the most commonly used rules can be condensed into a single line. You do need to be aware that order in which you place the CSS values does make a difference. Also, CSS shortcuts should be tested in a range of browsers because CSS rules are not always interpreted the same. Internet Explorer 6 is very buggy when it comes to rendering CSS rules properly. You should test all style sheet code in all of the most popular browsers...&lt;/p&gt;&lt;/blockquote&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Styling Your Fonts&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;There are several ways to control the appearance of a font. Four of the most common are listed below:&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;Font size&lt;/li&gt;
							&lt;li&gt;Font style&lt;/li&gt;
							&lt;li&gt;Font weight&lt;/li&gt;
							&lt;li&gt;Font variant&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;Let's look at each of these in turn.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Font size&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;The meaning of the CSS attribute &lt;code&gt;font-size&lt;/code&gt; is pretty obvious. It controls the size of the font as it appears on your display. There are several ways to choose the size of your font: &lt;em&gt;pixels, ems, percentages,&lt;/em&gt; and &lt;em&gt;keywords.&lt;/em&gt; You might want to review the section on units of size:&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinsize.html" title="Web Design Principles Units of Measuring Size"&gt;More about &lt;em&gt;units of measuring size&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Pixels are absolute across all browsers. Setting your font's size in pixels prevents some browsers, particularly Internet Explorer 6 and7, from allowing a user to resize the font using the text-resize function in their browsers. Firefox and Safari users can resize pixel-defined fonts, while Opera and IE7 users have a "zoom" function that resizes the page quickly and easily, text included. One popular "baseline" font size is 16px:&lt;/p&gt;
						&lt;pre&gt;body {
   font-size: 16px;
}&lt;/pre&gt;
						&lt;p&gt;Ems are relative units of measurement. It is considered &lt;a href="http://www.w3.org/WAI/GL/css2em.htm" title="The amazing em unit and other best practices"&gt;best practice&lt;/a&gt; to use ems whenever possible in sizing fonts (and other Web elements). It is &lt;em&gt;scalable,&lt;/em&gt; which means that it resizes relative to its &lt;em&gt;parent&lt;/em&gt; element. (Confused yet?) If you set a font size on the body, or even better, if you &lt;em&gt;don't&lt;/em&gt; set a font size on the body, thereby leaving it up to the user's own preferences, the subsequent font elements — headers, paragraphs, list items, margins, paddings, and the like — will resize relative to that original "parent" size.&lt;/p&gt;
						&lt;p&gt;We'll go back to the popular 16-pixel base size for our example. If your user has chosen 16 pixels as his base font size (or more likely, your user hasn't chosen anything and left it to his browser default), everything you size will be relative to that 16px base. For example:&lt;/p&gt;
						&lt;pre&gt;h1 {
   font-size: 2em;
}

h2 {
   font-size: 1.5em;

p {
   font-size: .9em;
}

ul li {
   font-size: 1.2em;
}&lt;/pre&gt;
						&lt;p&gt;makes the following size choices:&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;Your &lt;code&gt;h1&lt;/code&gt; elements will be twice the size (2em) of the base font size of 16px — in essence, 32px.&lt;/li&gt;
							&lt;li&gt;Your &lt;code&gt;h2&lt;/code&gt; elements will be 1.5 times the size (1.5em) of the base font size of 16px — in essence, 24px.&lt;/li&gt;
							&lt;li&gt;Your &lt;code&gt;p&lt;/code&gt; elements will be .9 times, or 90% (.9em) of the base font size of 16px — about 14px.&lt;/li&gt;
							&lt;li&gt;Your &lt;code&gt;li&lt;/code&gt; elements (in your &lt;code&gt;ul&lt;/code&gt;) will be 1.2 times, or 120% (1.2em) of the base font size of 16px — about 19px.&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;Change the base font size from 16px to something else, say 12px, and the relative sizes change as well:&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;Your &lt;code&gt;h1&lt;/code&gt; elements will be twice the size (2em) of the base font size of 12px — in essence, 24px.&lt;/li&gt;
							&lt;li&gt;Your &lt;code&gt;h2&lt;/code&gt; elements will be 1.5 times the size (1.5em) of the base font size of 12px — in essence, 18px.&lt;/li&gt;
							&lt;li&gt;Your &lt;code&gt;p&lt;/code&gt; elements will be .9 times, or 90% (.9em) of the base font size of 12px — about 11px.&lt;/li&gt;
							&lt;li&gt;Your &lt;code&gt;li&lt;/code&gt; elements (in your &lt;code&gt;ul&lt;/code&gt;) will be 1.2 times, or 120% (1.2em) of the base font size of 12px — about 14px.&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;(&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html#a625" title="The 62.5 Method of Sizing Fonts"&gt;See below&lt;/a&gt; for a different take on using ems in your layout.)&lt;/p&gt;
						&lt;p&gt;Percentages are quite similar to ems in their effect on your font sizing. Percentages work like so:&lt;/p&gt;
						&lt;pre&gt;h1 {
   font-size: 200%;
}

h2 {
   font-size: 150%;

p {
   font-size: 90%;
}

ul li {
   font-size: 120%;
}&lt;/pre&gt;
						&lt;p&gt;&lt;a href="http://developer.yahoo.com/yui/fonts/#default" title="Font-size Adjustment"&gt;Yahoo Development Network&lt;/a&gt; gives us a useful chart that tells us what percentage to use to get our fonts at a particular pixel size, i.e. 16px=123.1%. The chart assumes a default of 13px and a 16px line-height, and assumes the user has not altered the browser or monitor defaults.&lt;/p&gt;

						&lt;p&gt;&lt;em&gt;Font style&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;This seems a bit generic of a term to use, considering everything we're doing is "styling" fonts. But this font attribute simply controls whether the font presents itself as normal (the default value), italicized, or oblique:&lt;/p&gt;
						&lt;pre&gt;p {
   font-style: italic;
}

h4 {
   font-style: oblique;
}&lt;/pre&gt;
						&lt;p&gt;The &lt;code&gt;oblique&lt;/code&gt; value isn't used often, mostly because a lot of fonts don't have an oblique version. Most browsers use italics as a substitute for obliques.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Font weight&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;The &lt;code&gt;font-weight&lt;/code&gt; attribute helps you decide how much "weight," or thickness, to add to a font. It gives you some finer control than the usual "boldface," or HTML &lt;code&gt;&amp;lt;strong&amp;gt; &amp;lt;/strong&amp;gt;&lt;/code&gt; tag. Basically, it goes from 100 to 900 in gradations of 100 (in other words, a &lt;code&gt;font-weight&lt;/code&gt; of 247 won't be of any use). Stick to 100, 200, 300, and so on.&lt;/p&gt;
						&lt;p&gt;Many browsers won't display a lot of difference between the 100s, either. While you can use them if you like, you'll probably be just as well served sticking to the three most popular &lt;code&gt;font-weight&lt;/code&gt; values: 100 (light), 400 (normal), and 700 (heavy, or bold):&lt;/p&gt;
						&lt;pre&gt;p {
   font-weight: 100;
}
&lt;span&gt;OR&lt;/span&gt;
p {
   font-weight: 400;
}
&lt;span&gt;OR&lt;/span&gt;
p {
   font-weight: 700;
}&lt;/pre&gt;
						&lt;p&gt;You can also use keyword values such as &lt;code&gt;bold&lt;/code&gt;, &lt;code&gt;bolder&lt;/code&gt;, and &lt;code&gt;normal&lt;/code&gt;, but few designers use these.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Font Variant&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;There is only one "variant" in the &lt;code&gt;font-variant&lt;/code&gt; group, the ability to have fonts appear in &lt;span style="font-variant:small-caps"&gt;small caps&lt;/span&gt;. Not every font supports small caps. Here's how to use it:&lt;/p&gt;
						&lt;pre&gt;p {
   font-variant: small-caps;
}&lt;/pre&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;The 62.5% Method of Sizing Fonts&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;I know I talked about font sizing just above, but this is tricky enough to warrant its own section.&lt;/p&gt;
						&lt;p&gt;This information is based on &lt;a href="http://www.amazon.com/Essential-Guide-HTML-Design-Essentials/dp/1590599071/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1274231475&amp;amp;sr=1-1" title="The Essential Guide to CSS&#xD;
and HTML Web Design"&gt;the excellent book by Craig Grannell&lt;/a&gt; that I reference throughout this site, &lt;a href="http://trevordavis.net/blog/tutorial/the-6-most-important-css-techniques-you-need-to-know/" title="The 6 Most Important CSS Techniques You Need To Know"&gt;a blog post by Trevor Davis&lt;/a&gt;, and &lt;a href="http://www.clagnut.com/blog/348/" title="How to size text using ems"&gt;two&lt;/a&gt; &lt;a href="http://www.alistapart.com/articles/howtosizetextincss/" title="How to Size Text in CSS"&gt;articles&lt;/a&gt; by the inventor of this technique, Richard Rutter.&lt;/p&gt;
						&lt;p&gt;Basically, the idea is to set your base font size in your &lt;code&gt;body&lt;/code&gt; (or whatever other governing element you choose to use, i.e. your &lt;code&gt;wrapper&lt;/code&gt;) to 62.5%. This causes your base font size to display at 10 pixels in most browsers. By doing this, 1em of size is equivalent to 10px.&lt;/p&gt;
						&lt;p&gt;Designers do this primarily because Internet Explorer won't resize text set in pixels. Some later versions of IE will "zoom" the entire page, but that pain-in-the-rumpus browser won't resize just the text, like just about every other browser does.&lt;/p&gt;
						&lt;p&gt;Rutter writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Text for the screen is sized with CSS in terms of pixels, ems or keywords. As most of us know, sizing with pixels is easy: get your selector and give it a font-size — no more thought required. Sizing with keywords is more complicated and requires a few workarounds, but you're in luck as the techniques are well documented. That leaves ems. At this point people often leg it. "Ems are too inconsistent," they say, "they're too hard; they never work." ... If the world were an ideal place, we'd all use pixels. But it's not, we have the broken browser to contend with. IE/Win will not allow readers to resize text that has been sized in pixels. Like it or not, your readers will want to resize text at some point. Perhaps they are short-sighted, doing a presentation, using a ridiculously high resolution laptop or simply have tired eyes. So unless you know (not think) your audience won’t be using IE/Win or will never wish to resize their text then pixels are not yet a viable solution. ... Using ems however, allows all browsers to resize text and also provides pixel-level precision and so they tend to be my unit of choice.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Davis notes that he does something slightly different:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Although I typically then set my container font-size to 1.2em, which in turn sets the font-size to 12 pixels. But still, then you know that 1em is equal to 12 pixels.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Rutter agrees, noting that "10px text is too small for the real world." Using his technique allows us to do the following:&lt;/p&gt;
						&lt;p&gt;1em is 10px, 0.8em is 8px, 1.2em is 12px, 1.6em is 16px, and so forth.&lt;/p&gt;
						&lt;p&gt;You have to size the individual elements — the paragraphs, headers, list items, etc — but this method gives you a great deal of control over your font sizes, and enables you to use ems quickly and easily. Basically, Rutter has done the math for you.&lt;/p&gt;
						&lt;p&gt;This isn't a foolproof method by any stretch: there are issues with it, which is why many designers (including myself, at least as of this writing) don't use it. (One problem is that ems cascade and pixels do not, which means that if you size your body fonts at, say, 1.3em and your h1 at 1.5em, your h1 will display at 19.5px, not 15px as you may have planned. Kudos to &lt;a href="http://www.imarc.net/communique/310-9_expert_css_ideas_you_should_think_twice_about_before_using" title="9 Expert CSS Ideas You Should Think Twice About Before Using"&gt;Will Bond&lt;/a&gt; for pointing this out. And SitePoint adviser &lt;a href="http://www.sitepoint.com/forums/showthread.php?t=620506" title="SitePoint forum thread about the 62.5 body font"&gt;Stephen Chapman&lt;/a&gt; notes that 1em won't necessarily equal 10px unless the user's screen resolution is set to 1em=16px, which it often is, but not always. In a related SitePoint thread, design adviser &lt;a href="http://www.sitepoint.com/forums/showthread.php?p=3923587" title="Relative font sizes"&gt;Paul O'Brien&lt;/a&gt; gives an excellent method of setting &lt;em&gt;all&lt;/em&gt; browser displays to a default of 13px.) But many, many designers swear by it. You may well adopt it for your own purposes.&lt;/p&gt;
						&lt;p&gt;One excellent source of information on this method, and the use of ems in general for sizing fonts, is &lt;a href="http://jontangerine.com/log/2007/09/the-incredible-em-and-elastic-layouts-with-css" title="The Incredible Em and Elastic Layouts with CSS"&gt;Jon Tan's article on ems and elastic layouts&lt;/a&gt;.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;

						&lt;p&gt;&lt;strong&gt;Further Reading&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Reading &lt;a href="http://jontangerine.com/" title="Pith and Pulp"&gt;Jon Tan&lt;/a&gt; is a must for anyone interested in the finer aspects of typography and fonts for the Web. (And check out the subtly elegant site design while you're there.) If you're not sure where to start, try &lt;a href="http://jontangerine.com/log/2007/12/what-future-for-web-typography-and-screen-fonts" title="What Future for Web Typography &amp;amp; Screen Fonts?"&gt;this entry first&lt;/a&gt;, and go from there.&lt;/p&gt;
						&lt;p&gt;Typography maven and Web design expert Jason Santa Maria gives us &lt;a href="http://www.alistapart.com/articles/on-web-typography" title="On Web Typography"&gt;an excellent overview, with detailed examples&lt;/a&gt;, for using a variety of fonts in your designs.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194674259"><id gr:original-id="">tag:google.com,2005:reader/item/404e3dc5962c4707</id><title type="html">Block and Inline Elements » Best Practices HTML and CSS</title><published>2010-05-30T04:44:34Z</published><updated>2010-05-30T04:44:34Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Block and Inline Elements&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/sunbrick.jpg" alt="sunlight on bricks" title="sunlight on bricks"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;Information on block and inline elements.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;Placeholder for pithy quote.&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html#block" title="Block-Level Elements"&gt;Block-Level Elements&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html#size" title="Sizing the Blocks"&gt;Sizing the Blocks&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html#box" title="The Box Model"&gt;The Box Model&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html#inline" title="Inline Elements"&gt;Inline Elements&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/html_valid.png" alt="html icon" title="html icon"&gt;&lt;/div&gt;
						&lt;p&gt;There are two kinds of elements in HTML: &lt;span&gt;block&lt;/span&gt; and &lt;span&gt;inline&lt;/span&gt;. The difference is, as &lt;a href="http://articles.sitepoint.com/article/html-37-steps-perfect-markup" title="Bulletproof HTML"&gt;Tommy Olsson&lt;/a&gt; writes, "mainly semantic and grammatical." But I think we can decrypt Tommy's description to provide a more colloquial understanding.&lt;/p&gt;
						&lt;p&gt;I'm going to start by quoting a long but excellent metaphor from &lt;a href="http://www.sitepoint.com/books/html2/" title="Build Your Own Web Site The Right Way"&gt;Ian Lloyd&lt;/a&gt; (emphasis mine):&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;I've moved house recently. When was the last time you moved? It's amazing how much stuff we seem to amass, especially those little trinkets that collect dust on the mantelpiece. You have to find some small boxes to put these bits and pieces in so they don't get damaged, and of course you then need some larger packing boxes into which you can put those smaller boxes. So on the day before the move — possibly earlier if you're more organized than I am — you start to place your trinkets into small boxes (here's a tip: shoe boxes work well). You then place those shoe boxes into bigger boxes, along with some books and those video tapes of the &lt;strong&gt;X-Files&lt;/strong&gt; that you know you'll never watch but can't bring yourself to throw away. This process continues through the night, and eventually (usually about three minutes before the moving truck is due to arrive) all of your stuff is finally packed and ready to go (whew!). &lt;strong&gt;If you think of the different types of boxes as block-level elements, and your other stuff — the books, videos and trinkets — as inline elements, you'll start to understand the difference between the element types.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Two differences I have with Ian on this: one, my wife insists on having us packed days before we are to move, and two, I fully intend to watch some of my &lt;em&gt;X-Files&lt;/em&gt; videotapes again someday....&lt;/p&gt;						
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Block-Level Elements&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Block-level elements act as "containers" for other elements. In other words, you put other elements inside block elements. Lloyd again:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;A block-level element can contain other block-level elements, as well as inline
elements.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Here's an incomplete list of block elements, courtesy of Olsson and &lt;a href="http://htmlhelp.com/reference/html40/block.html" title="HTML 4 Block-Level Elements"&gt;HTML Help&lt;/a&gt;:&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;&lt;span&gt;blockquote&lt;/span&gt;&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;div&lt;/span&gt;&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;header&lt;/span&gt; (i.e. &lt;code&gt;h1&lt;/code&gt;)&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;p&lt;/span&gt;&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;ul&lt;/span&gt;&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;ol&lt;/span&gt;&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;form&lt;/span&gt;&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;table&lt;/span&gt;&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;Some block-level elements, such as &lt;code&gt;p&lt;/code&gt;, can only contain text and inline elements. Others, such as &lt;code&gt;form&lt;/code&gt;, can contain only block-level elements (in HTML Strict coding, at least). And some, like the ubiquitous &lt;code&gt;div&lt;/code&gt;, can contain text, inline, and block-level elements.&lt;/p&gt;
&lt;p&gt;Unless you override the browser's default styling, block-level elements such as &lt;code&gt;p&lt;/code&gt; and &lt;code&gt;div&lt;/code&gt; have an implicit line break both before and after, making it impossible to have two block-level elements side by side on the same page. (CSS commands can override this.)&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Sizing the Blocks&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;By default, a block-level element expands to a width of 100% of its parent container, whether it be the entire &lt;code&gt;body&lt;/code&gt; element, a container element such as a &lt;code&gt;div&lt;/code&gt;, or something else. It will also expand by default to whatever height it needs to have. But remember — "default" means "I can change it." So let's see how we can change the default width and height of a block-level element.&lt;/p&gt;
						&lt;p&gt;(In doing this, we're moving towards learning how to create &lt;em&gt;layouts&lt;/em&gt; for our pages. Are you excited yet?&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html#nogo" title="coming soon"&gt;More about &lt;em&gt;layouts&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;You can see this by looking at this very text. This text that you're reading right now is contained inside a block-level element — a &lt;code&gt;p&lt;/code&gt; — that, except for imposed padding, stretches to take up the entire center column of this page. However, the light gray and dark gray boxes (in &lt;code&gt;p&lt;/code&gt;, &lt;code&gt;ul&lt;/code&gt;, and &lt;code&gt;pre&lt;/code&gt; block-level elements respectively) have their widths constrained to, I believe, 95%. That prevents them from ramming up against the right-hand border of the center column.&lt;/p&gt;
						&lt;p&gt;Let's give an example.&lt;/p&gt;
						&lt;p&gt;Say you want to "punch up" a particular paragraph, to get the attention of your readers. You create a "punchup" class:&lt;/p&gt;
						&lt;pre&gt;.punchup {
   width: 50%;
   padding: 5px;
   font-weight: bold;
   color: #ff0000;
   font-size: 1.25em;
   background-color: #ffe4e1;
}&lt;/pre&gt;
						&lt;p&gt;Any paragraph with the &lt;code&gt;.punchup&lt;/code&gt; class will be constrained to 50% of the width of its parent container, has some padding, will be in bold, will be bright red, will be 25% larger than the other text, and has a light pink background to make it stand out that much further.&lt;/p&gt;
						&lt;pre&gt;&amp;lt;p class=&amp;quot;punchup&amp;quot;&amp;gt;This text is guaranteed to snag the attention of all your readers. Woo-hoo!&amp;lt;/p&amp;gt;&lt;/pre&gt;
						&lt;p&gt;It looks like this:&lt;/p&gt;
						&lt;p style="width:50%;padding:5px;font-weight:bold;color:#f00;font-size:1.25em;background-color:#ffe4e1"&gt;This text is guaranteed to snag the attention of all your readers. Woo-hoo!&lt;/p&gt;
						&lt;p&gt;With all the fancy text formatting used in that class, the &lt;code&gt;width&lt;/code&gt; constraint may make the biggest impact, as it sets that text apart from the surrounding text.&lt;/p&gt;
						&lt;p&gt;We could add &lt;code&gt;height&lt;/code&gt; to the code also:&lt;/p&gt;
						&lt;pre&gt;height: 250px;&lt;/pre&gt;
						&lt;p&gt;giving us:&lt;/p&gt;
						&lt;p style="width:50%;height:250px;padding:5px;font-weight:bold;color:#f00;font-size:1.25em;background-color:#ffe4e1"&gt;This text is guaranteed to snag the attention of all your readers. Woo-hoo!&lt;/p&gt;
						&lt;p&gt;Notice that the element is significantly elongated vertically, and is flush against the left side of the container (minus padding). We could increase the height even more, and use this structure to develop a vertical "sidebar" for a page, maybe containing a navigation scheme or other such info. And we will, a bit later on.&lt;/p&gt;
						&lt;p&gt;You can also add &lt;em&gt;borders&lt;/em&gt; to block-level elements, further defining the blocked-out space. &lt;span&gt;Insider tip:&lt;/span&gt; Not only do borders often look good in a final design, many designers use a 1px black border around &lt;em&gt;all&lt;/em&gt; of their elements during the design process, to help them keep track of how their block-level elements are positioned on the page. They remove the borders before you and I see the final product.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinborders.html" title="Web Design Principles Borders"&gt;More about &lt;em&gt;borders&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;The Box Model&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;We're learning the rudiments of what Web designers call "the box model" — using block-level elements with margins, padding, height, and width values to construct "boxes" in which to contain our material. See the links below for more information.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmargins.html" title="Web Design Principles Margins and Padding"&gt;More about &lt;em&gt;margins and padding&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinpositioning.html" title="Web Design Principles Positioning Elements"&gt;More about &lt;em&gt;positioning elements&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinblock.html#nogo" title="coming soon"&gt;More about &lt;em&gt;layouts&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;

						&lt;p&gt;&lt;strong&gt;Inline Elements&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Inline elements function "inline" within text. Lloyd writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;An inline element can only contain other inline elements. ... It's perfectly okay to nest one inline element inside another. ... [However, i]nline elements can never contain block-level elements.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Again relying on Olsson and &lt;a href="http://htmlhelp.com/reference/html40/inline.html" title="HTML 4 Inline Elements"&gt;HTML Help&lt;/a&gt;, here's a partial and (very) incomplete list of the most popular inline elements in HTML:&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;&lt;span&gt;a&lt;/span&gt; (the anchor element)&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;cite&lt;/span&gt;&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;em&lt;/span&gt;&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;img&lt;/span&gt;&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;span&lt;/span&gt;&lt;/li&gt;
							&lt;li&gt;&lt;span&gt;strong&lt;/span&gt;&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;Inline elements do not contain block-level elements (with one exception, the &lt;code&gt;object&lt;/code&gt; element, which we won't get into here). Inline elements have no implied line breaks.&lt;/p&gt;
						&lt;p&gt;Some designers believe that they can transform an inline element with the CSS &lt;code&gt;display: block&lt;/code&gt; declaration. This does not work; i.e. you cannot put a &lt;code&gt;h1&lt;/code&gt; element inside a &lt;code&gt;a href&lt;/code&gt; link. Let's let Olsson explain this one:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;HTML has block-level and inline elements. CSS has block and inline boxes (plus a few others). These are very different things. The distinction in HTML has to do with semantics and syntax, while the distinction in CSS has to do with rendering and presentation. By default, block-level elements generate block boxes, and inline elements generate inline boxes (this is a grossly simplified explanation, but is generally true). The display property can change the type of the generated box, but CSS cannot change the grammatical or syntactical rules of HTML.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;&lt;span&gt;Note:&lt;/span&gt; One of the most important, and often overlooked, characteristics of the &lt;code&gt;img&lt;/code&gt; element is that it is an inline element and not a block-level element. It &lt;strong&gt;must&lt;/strong&gt; be contained within a block-level element, usually a &lt;code&gt;div&lt;/code&gt; or a &lt;code&gt;p&lt;/code&gt;:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;p&amp;gt;Some text.&amp;lt;/p&amp;gt;
&amp;lt;img src=&amp;quot;images/picture.jpg&amp;gt; &lt;span&gt;This is WRONG.&lt;/span&gt;
&amp;lt;p&amp;gt;Some more text.&amp;lt;/p&amp;gt;&lt;/pre&gt;
						&lt;p&gt;This leaves the inline &lt;code&gt;img&lt;/code&gt; element stranded, with nothing to contain it.&lt;/p&gt;
						&lt;pre&gt;&amp;lt;p&amp;gt;Some text.&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img src=&amp;quot;images/picture.jpg&amp;gt;&amp;lt;p&amp;gt; &lt;span&gt;This is RIGHT.&lt;/span&gt;
&amp;lt;p&amp;gt;Some more text.&amp;lt;/p&amp;gt;&lt;/pre&gt;
						&lt;p&gt;This places the inline &lt;code&gt;img&lt;/code&gt; element inside a block container, all safe and snug.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194648349"><id gr:original-id="">tag:google.com,2005:reader/item/4342d2ec16ec580d</id><title type="html">Borders » Best Practices HTML and CSS</title><published>2010-05-30T04:44:08Z</published><updated>2010-05-30T04:44:08Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinborders.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinborders.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinborders.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Borders&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/icewater.jpg" alt="icy shore" title="icy shore"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;Short description of page contents.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;[W]hy should love stop at the border? — &lt;a href="http://www.brainyquote.com/quotes/quotes/p/pablocasal107010.html" title="Quote from BrainyQuote"&gt;Pablo Casals&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;				

						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinborders.html#styles" title="Border Styles"&gt;Border Styles&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinborders.html#widths" title="Border Widths"&gt;Border Widths&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinborders.html#colors" title="Border Colors"&gt;Border Colors&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinborders.html#directions" title="Border Directions"&gt;Border Directions&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinborders.html#combo" title="Border Combinations"&gt;Border Combinations&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;CSS allows you to place &lt;em&gt;borders&lt;/em&gt; around elements such as paragraphs, divs, and other block-level items. You have a number of options as to both styles and widths.&lt;/p&gt;
						&lt;p&gt;&lt;strong&gt;Border Styles&lt;/strong&gt;&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;solid&lt;/li&gt;
							&lt;li&gt;double&lt;/li&gt;
							&lt;li&gt;groove&lt;/li&gt;
							&lt;li&gt;dotted&lt;/li&gt;
							&lt;li&gt;dashed&lt;/li&gt;
							&lt;li&gt;inset&lt;/li&gt;
							&lt;li&gt;outset&lt;/li&gt;
							&lt;li&gt;ridge&lt;/li&gt;
							&lt;li&gt;hidden (the default)&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;Let&amp;#39;s take a look at how they shape up in our stylesheet. We&amp;#39;ll use the &amp;lt;p&amp;gt; element to hang our border on, and give each paragraph a class corresponding to the border style.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html" title="Web Design Principles Classes and IDs"&gt;More about &lt;em&gt;classes&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;pre&gt;p.solid {
   border-style: solid; 
}

&lt;span&gt;OR&lt;/span&gt;

p.double {
   border-style: double; 
} 

&lt;span&gt;OR&lt;/span&gt;

p.groove {
   border-style: groove; 
} 

&lt;span&gt;OR&lt;/span&gt;

p.dotted {
   border-style: dotted; 
} 

&lt;span&gt;OR&lt;/span&gt;

p.dashed {
   border-style: dashed; 
} 
&lt;span&gt;OR&lt;/span&gt;

p.inset {
   border-style: inset; 
} 
&lt;span&gt;OR&lt;/span&gt;

p.outset {
   border-style: outset; 
} 

&lt;span&gt;OR&lt;/span&gt;

p.ridge {
   border-style: ridge; 
} 
&lt;span&gt;OR&lt;/span&gt;

p.hidden {
   border-style: hidden; 
}&lt;/pre&gt;
						&lt;p&gt;gives us:&lt;/p&gt;
						&lt;p style="border-style:solid;width:95%"&gt;This paragraph has a solid border around it.&lt;/p&gt;
						&lt;p style="border-style:double;width:95%"&gt;This paragraph has a double border around it.&lt;/p&gt;
						&lt;p style="border-style:groove;width:95%"&gt;This paragraph has a grooved border around it.&lt;/p&gt;
						&lt;p style="border-style:dotted;width:95%"&gt;This paragraph has a dotted border around it.&lt;/p&gt;
						&lt;p style="border-style:dashed;width:95%"&gt;This paragraph has a dashed border around it.&lt;/p&gt;
						&lt;p style="border-style:inset;width:95%"&gt;This paragraph has an inset border around it.&lt;/p&gt;
						&lt;p style="border-style:outset;width:95%"&gt;This paragraph has an outset border around it.&lt;/p&gt;
						&lt;p style="border-style:ridge;width:95%"&gt;This paragraph has a ridged border around it.&lt;/p&gt;
						&lt;p style="border-style:hidden;width:95%"&gt;This paragraph's border is hidden.&lt;/p&gt;
						&lt;p&gt;Almost no one uses the &lt;code&gt;hidden&lt;/code&gt; value for a border unless it is to override an earlier styling.&lt;/p&gt;
						
						&lt;p&gt;&lt;strong&gt;Border Widths&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Border widths work only if styles are also chosen (obviously). You can make your border a single pixel in width or something hugely big, whatever works for your design needs. While there are keywords such as "medium" and "thick" available, I've never seen anyone use them. Stick with pixels.&lt;/p&gt;
						 &lt;pre&gt;p.groove {
   border-style: groove;
   border-width: 10px;
}&lt;/pre&gt;
						&lt;p&gt;gives us&lt;/p&gt;
						&lt;p style="border-style:groove;border-width:10px;width:95%"&gt;This paragraph has a grooved border 10 pixels in width.&lt;/p&gt;
						
						&lt;p&gt;&lt;strong&gt;Border Colors&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By default, borders show in black in most browsers. If you find that boring, you can change that color to something far more spiffy.&lt;/p&gt;
 &lt;pre&gt;p.groove {
   border-style: groove;
   border-width: 10px;
   border-color: #f25f0f;
}&lt;/pre&gt;
						&lt;p&gt;gives us this:&lt;/p&gt;
						&lt;p style="border-style:groove;border-width:10px;border-color:#f25f0f;width:95%"&gt;This paragraph has a grooved border 10 pixels wide, colored in spiffy orange.&lt;/p&gt;
						&lt;p&gt;(Notice that some border styles automatically give a lighter variant of the selected color to help create the groove, or ridge, or whatever styling.)&lt;/p&gt;
						&lt;p&gt;You can use other color value methods such as RGB or keywords (i.e. &lt;code&gt;100 100 255&lt;/code&gt; or &lt;code&gt;blue&lt;/code&gt;, but I prefer the hexes.&lt;/p&gt;
						
						&lt;p&gt;&lt;strong&gt;Setting the Direction of Your Borders&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;So far we've looked at making borders for all four sides of the block element. If you want a border on fewer than four sides, that's easy to implement.&lt;/p&gt;
						&lt;p&gt;The key is the &lt;code&gt;border-[direction]&lt;/code&gt; property. You pick your choice of direction (or side):&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;top&lt;/li&gt;
							&lt;li&gt;right&lt;/li&gt;
							&lt;li&gt;bottom&lt;/li&gt;
							&lt;li&gt;left&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;No surprise there....&lt;/p&gt;
						&lt;p&gt;However, most designers don't use it by itself, but in conjunction with other border style properties.  Here are some examples, cribbed from the page at &lt;a href="http://www.tizag.com/cssT/border.php" title="CSS Border"&gt;Tizag.&lt;/a&gt; You can get an idea of how it's used, and then try your own combinations.&lt;/p&gt;
						&lt;pre&gt;p { border-bottom-style: dashed; 
   border-bottom-color: yellow; 
   border-bottom-width: 5px; 
}&lt;/pre&gt;
						&lt;p&gt;gives us:&lt;/p&gt;
						&lt;p style="border-bottom-style:dashed;border-bottom-color:yellow;border-bottom-width:5px;width:95%"&gt;This paragraph has a yellow, dashed bottom border 5 pixels in width.&lt;/p&gt;
						&lt;pre&gt;p { border-top-style: double; 
   border-top-color: purple; 
   border-top-width: thick;
}&lt;/pre&gt;
						&lt;p&gt;gives us:&lt;/p&gt;
						&lt;p style="border-top-style:double;border-top-color:purple;border-top-width:thick;width:95%"&gt;This paragraph has a purple, double top border using the "thick" CSS value (which we normally don't use).&lt;/p&gt;
						&lt;p&gt;And you can add multiple border styles to a single paragraph (or other element) for maximum, over-the-top styling.&lt;/p&gt;
						
						&lt;p&gt;&lt;strong&gt;Combining the Selectors and Values&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Most designers don't waste time and bandwidth writing multiple lines of border code. It's much easier to combine them into one line, using the &lt;code&gt;border&lt;/code&gt; property.&lt;/p&gt;
						&lt;p&gt;Here's one example, combining three values of width, style, and color:&lt;/p&gt;
						&lt;pre&gt;p {
   border: 20px outset blue;
}&lt;/pre&gt;
						&lt;p&gt;giving us:&lt;/p&gt;
						&lt;p style="border:20px outset blue;width:90%"&gt;This paragraph has a border 20 pixels wide, blue in color, and outset.&lt;/p&gt;
						
					&lt;/div&gt;
				&lt;/div&gt;
				
				&lt;div&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194622401"><id gr:original-id="">tag:google.com,2005:reader/item/26bbe1dade431258</id><title type="html">Margins and Padding » Best Practices HTML and CSS</title><published>2010-05-30T04:43:42Z</published><updated>2010-05-30T04:43:42Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmargins.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmargins.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmargins.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Margins and Padding&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/bubbles.jpg" alt="orange bubbles" title="orange bubbles"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;The many ways to add margins and padding to HTML elements.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;Placeholder for pithy quote.&lt;/p&gt;&lt;/blockquote&gt;

						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmargins.html#margins" title="Margins"&gt;Margins&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmargins.html#padding" title="Padding"&gt;Padding&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinmargins.html#quirks" title="Internet Explorer 5.5&amp;#39;s Quirky Handling of Margins and Padding"&gt;IE 5.5 Quirks&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;Margins and padding both provide space between various HTML elements. But they do it in somewhat different ways.&lt;/p&gt;
						&lt;p&gt;One of the most confusing differences in Web design is between &lt;em&gt;margins&lt;/em&gt; and &lt;em&gt;padding&lt;/em&gt;, and the decision as to when to use one or the other sometimes puzzles even knowledgeable designers. So let's start with the difference between the two. I cribbed this from &lt;a href="http://lkamal.blogspot.com/2006/12/margin-vs-padding-css-properties.html" title="Margin Vs Padding - CSS Properties"&gt;an excellent short article on the subject by Kamal Mettananda&lt;/a&gt;.&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;&lt;em&gt;Margin&lt;/em&gt;: defines space between border and other outer elements.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Padding&lt;/em&gt;: defines space between border and element content.&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;What does that mean, exactly? Let's take a look at the diagram (used with permission from &lt;a href="http://lkamal.blogspot.com/2006/12/margin-vs-padding-css-properties.html" title="Margin Vs Padding - CSS Properties"&gt;Kamal Mettananda&lt;/a&gt;).&lt;/p&gt;
						&lt;div&gt;
							&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/margin_padding.jpg" alt="illustrative graphic of margins and paddings" title="graphic of margins and paddings"&gt;
						&lt;/div&gt;
						&lt;p&gt;See the difference? When &lt;strong&gt;separate elements&lt;/strong&gt; need space &lt;strong&gt;between&lt;/strong&gt; them, use a &lt;em&gt;margin&lt;/em&gt;. When &lt;strong&gt;text&lt;/strong&gt; or an &lt;strong&gt;inner element&lt;/strong&gt; needs space between itself and its parent, use &lt;em&gt;padding&lt;/em&gt;.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Margins&lt;/strong&gt;
						&lt;/p&gt;&lt;p&gt;As we can see in the graphic above, margins define the "negative space," or "whitespace," around an HTML element such as a paragraph, a header, an image, a div, or something else.&lt;/p&gt;
						&lt;pre&gt;p {
   margin: 15px; 
   border: 1px solid black;
} &lt;/pre&gt;
						&lt;p&gt;gives us:&lt;/p&gt;
						&lt;p style="width:95%;margin:15px;border:1px solid black"&gt;This paragraph has a nice fat margin of 15 pixels on every side. The border shows you where the edge of the &amp;lt;p&amp;gt; element is.&lt;/p&gt;
						&lt;p&gt;How can you tell? The example paragraph is somewhat farther away from the rest of the text than other paragraphs in this section. That's because of the margin. (The space between the top, right, bottom, and left edges of the paragraph itself and the border is the default padding added by your browser. See below for more on padding.)&lt;/p&gt;
						&lt;p&gt;Elements such as the paragraph have some default margins built into the browsers' own stylesheets (yes, they have them, and they are different from one browser to the next), but it usually isn't much, and you can't rely on it to drive your design. Best to control your margins yourself.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Margin Units of Measurement&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Like so many other things on the Web, you can use margins with pixels, ems, or percentages:&lt;/p&gt;
						&lt;pre&gt;p {
   margin: 15px;
} 

&lt;span&gt;OR&lt;/span&gt;

p {
   margin: 1em; 
} 

&lt;span&gt;OR&lt;/span&gt;

p {
   margin: 2%; 
}
&lt;/pre&gt;
						&lt;p&gt;Some situations call for one, some for the other. I've never used percentages in margins myself, so I can't speak to that one. I've used both pixels and ems frequently. Remember, ems are flexible and pixels are absolute and unchanging (as much as anything on the Web is "unchanging" ...)&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Margins for the Four Sides&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Sometimes you want an equal amount of margins on all four sides of a "box" element such as our paragraph above. In that case, you get off easy. The default for margins is to set all four sides equally:&lt;/p&gt;
						&lt;pre&gt;p {
   margin: 15px; 
} &lt;/pre&gt;
						&lt;p&gt;gives us a paragraph with 15 pixels' worth of margins on each of the four sides — top, right, bottom, and left.&lt;/p&gt;
						&lt;p&gt;&lt;em&gt;TRouBLe&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;The four values of the margins go in clockwise order: from the &lt;em&gt;top&lt;/em&gt;, to the &lt;em&gt;right&lt;/em&gt;, to the &lt;em&gt;bottom&lt;/em&gt;, and finally to the &lt;em&gt;left&lt;/em&gt;.&lt;/p&gt;
						&lt;p&gt;An easy memory prompt (a mnemonic) is to remember the word &lt;span title="Top"&gt;T&lt;/span&gt;&lt;span title="Right"&gt;R&lt;/span&gt;ou&lt;span title="Bottom"&gt;B&lt;/span&gt;&lt;span title="Left"&gt;L&lt;/span&gt;e (&lt;em&gt;trouble&lt;/em&gt;) for the Top Right Bottom Left order. If you don't follow the order properly, you'll be in TRouBLe.&lt;/p&gt;
						&lt;p&gt;You can add different margins to each side of your paragraph or other HTML element. The order is, as I noted, clockwise, but let's start with the longhand version:&lt;/p&gt;
						&lt;pre&gt;p {
   margin-top: 0px;
   margin-right: 2px;
   margin-bottom: 40px;
   margin-left: 5px;
   border: 1px solid black;
}&lt;/pre&gt;
						&lt;p&gt;gives us something like:&lt;/p&gt;
						&lt;p style="width:95%;margin:0 2px 40px 5px;border:1px solid black"&gt;This paragraph has a different margin on each of its four sides. As with the other example, the border shows the outer edge of the &amp;lt;p&amp;gt; element.&lt;/p&gt;
						&lt;p&gt;Do you have to write so many properties when you add margins to a single element? No! You can use shortcuts. The same margin values in the above example can be shortened in your coding:&lt;/p&gt;
						&lt;pre&gt;p {
   margin: 0 2px 40px 5px;
}&lt;/pre&gt;
						&lt;p&gt;for the exact same result:&lt;/p&gt;
						&lt;p style="width:95%;margin:0 2px 40px 5px;border:1px solid black"&gt;This paragraph has a different margin on each of its four sides, but this time we used a nifty shortcut. Again, the border shows the outer edge of the &amp;lt;p&amp;gt; element.&lt;/p&gt;
						&lt;p&gt;Note the spacing between the four values, and note that the values go clockwise around the four sides of the box, our "TRouBLe" paradigm.&lt;/p&gt;
						&lt;p&gt;Often we want to add one value of a margin to the left and right, and another to the top and bottom. We can do that with CSS shortcuts also:&lt;/p&gt;
						&lt;pre&gt;p {
   margin: 20px 5px;
}&lt;/pre&gt;
						&lt;p&gt;In this case, the first value controls the top and bottom margins, and the second value controls the right and left margins:&lt;/p&gt;
						&lt;p style="width:95%;margin:20px 5px;border:1px solid black"&gt;This paragraph has top and bottom margins of 20px and right and left margins of 5px. The border shows the outer edge of the &amp;lt;p&amp;gt; element.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Padding&lt;/strong&gt;
						&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.tizag.com/cssT/padding.php" title="CSS Padding"&gt;Tizag gives us a succinct explanation&lt;/a&gt; of &lt;em&gt;padding&lt;/em&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;A padding is the space between an element's border and the content within it.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;In real-world terms, we often use padding to give us some "negative space," "whitespace," or simply some breathing room between text or an image and its containing border. Here's two examples (you'll see how similar they are to the examples in the margin section just above):&lt;/p&gt;
						&lt;pre&gt;p {
   padding: 15px; 
   border: 1px solid black;
} &lt;/pre&gt;
						&lt;p&gt;gives us:&lt;/p&gt;
						&lt;p style="width:95%;padding:15px;border:1px solid black"&gt;This paragraph has a nice fat padding of 15 pixels on every side. The border shows you where the edge of the &amp;lt;p&amp;gt; element is.&lt;/p&gt;
						&lt;p&gt;To the contrary, here's this:&lt;/p&gt;
						&lt;pre&gt;p {
   padding: 0; 
   border: 1px solid black;
} &lt;/pre&gt;
						&lt;p&gt;gives us:&lt;/p&gt;
						&lt;p style="width:95%;padding:0;border:1px solid black"&gt;This paragraph has no padding at all. The border shows you where the edge of the &amp;lt;p&amp;gt; element is. Claustrophobic, isn&amp;#39;t it?&lt;/p&gt;
						&lt;p&gt;Like margins, elements such as the paragraph have some default padding built into the browsers' own stylesheets (yes, they have them, and they are different from one browser to the next), but it usually isn't much, and you can't rely on it to drive your design. Best to control your padding yourself.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Padding Units of Measurement&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Like so many other things on the Web, you can use padding with pixels, ems, or percentages:&lt;/p&gt;
						&lt;pre&gt;p {
   padding: 15px;
} 

&lt;span&gt;OR&lt;/span&gt;

p {
   padding: 1em; 
} 

&lt;span&gt;OR&lt;/span&gt;

p {
   padding: 2%; 
}
&lt;/pre&gt;
						&lt;p&gt;As I wrote above for margins, some situations call for one, some for the other. I've never used percentages in padding myself. I've used both pixels and ems frequently. Remember, ems are flexible and pixels are absolute and unchanging (as much as anything on the Web is "unchanging" ...)&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Padding the Four Sides&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Sometimes you want an equal amount of padding on all four sides of a "box" element such as our paragraph above. In that case, you get off easy. The default for padding is to set all four sides equally:&lt;/p&gt;
						&lt;pre&gt;p {
   padding: 15px; 
} &lt;/pre&gt;
						&lt;p&gt;gives us a paragraph with 15 pixels' worth of padding on each of the four sides — top, right, bottom, and left. (Notice I went around the four sides like a clock, from the top around clockwise to the right. We follow the same rule here as with margins: the four sides are dealt with in clockwise order by your stylesheet.)&lt;/p&gt;
						&lt;p&gt;You can add different paddings to each side of your paragraph or other HTML element. The order is, as I noted, clockwise, but let's start with the longhand version:&lt;/p&gt;
						&lt;pre&gt;p {
   padding-top: 0px;
   padding-right: 2px;
   padding-bottom: 20px;
   padding-left: 5px;
   border: 1px solid black;
}&lt;/pre&gt;
						&lt;p&gt;gives us something like:&lt;/p&gt;
						&lt;p style="width:95%;padding:0 2px 20px 5px;border:1px solid black"&gt;This paragraph has different padding on each of its four sides. As with the other example, the border shows the outer edge of the &amp;lt;p&amp;gt; element.&lt;/p&gt;
						&lt;p&gt;Do you have to write so many properties when you add padding to a single element? No! You can use shortcuts. The same padding values in the above example can be shortened in your coding:&lt;/p&gt;
						&lt;pre&gt;p {
   padding: 0 2px 20px 5px;
}&lt;/pre&gt;
						&lt;p&gt;for the exact same result:&lt;/p&gt;
						&lt;p style="width:95%;padding:0 2px 20px 5px;border:1px solid black"&gt;This paragraph has different padding on each of its four sides, but this time we used a nifty shortcut. Again, the border shows the outer edge of the &amp;lt;p&amp;gt; element.&lt;/p&gt;
						&lt;p&gt;Note the spacing between the four values, and note that the values go clockwise around the four sides of the box, our "TRouBLe" paradigm.&lt;/p&gt;
						&lt;p&gt;Often we want to add one value of padding to the left and right, and another to the top and bottom. We can do that with CSS shortcuts also:&lt;/p&gt;
						&lt;pre&gt;p {
   padding: 20px 5px;
}&lt;/pre&gt;
						&lt;p&gt;In this case, the first value controls the top and bottom padding, and the second value controls the right and left padding:&lt;/p&gt;
						&lt;p style="width:95%;padding:20px 5px;border:1px solid black"&gt;This paragraph has a top and bottom padding of 20px and a right and left padding of 5px. The border shows the outer edge of the &amp;lt;p&amp;gt; element.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Internet Explorer 5.5's Quirky Handling of Margins and Padding&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Note: Internet Explorer 5.5 for Windows does not deal with margins or padding (or borders, for that matter) correctly. If you find yourself unlucky enough to have to design for that rather antiquated browser, you might be interested in learning about the &lt;a href="http://tantek.com/CSS/Examples/boxmodelhack.html" title="Box Model Hack"&gt;box model hack&lt;/a&gt; that can get around IE5.5's problems.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194251265"><id gr:original-id="">tag:google.com,2005:reader/item/a89dd9ac76e319f1</id><title type="html">Different Kinds of Stylesheets » Best Practices HTML and CSS</title><published>2010-05-30T04:37:31Z</published><updated>2010-05-30T04:37:31Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Types of Stylesheets&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/splash.jpg" alt="yellow paint splash" title="illustrative graphic of yellow paint splash"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;The three different kinds of stylesheets, and more.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;Placeholder for pithy quote.&lt;/p&gt;&lt;/blockquote&gt;

						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html#external" title="External Stylesheets"&gt;External Stylesheets&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html#internal" title="Internal Stylesheets"&gt;Internal Stylesheets&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html#inline" title="Inline Styling"&gt;Inline Styling&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html#multiple" title="Linking Multiple External Stylesheets"&gt;Multiple Stylesheets&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html#media" title="Media Types"&gt;Media Types&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html#print" title="Creating Print Stylesheets"&gt;Creating "Print" Stylesheets&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;There are three ways to style your page with &lt;span title="Cascading Style Sheets"&gt;CSS&lt;/span&gt;:&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;&lt;em&gt;External&lt;/em&gt; — keeping it in a separate file;&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Internal&lt;/em&gt; — including it in the head of each page; and&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Inline&lt;/em&gt; — including individual style commands in the HTML itself.&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;There's one thing all three have in common: the same kinds of user mistakes. I've made them, others make them, and &lt;span&gt;you&lt;/span&gt; will make them. &lt;a href="http://www.tizag.com/cssT/internal.php" title="Internal CSS"&gt;Tizag.com&lt;/a&gt; gives us this reminder:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Until you become accustomed to using CSS code, you will probably find your CSS code not working as you expected. A leading cause of this might be an out of place &lt;code&gt;:&lt;/code&gt;, &lt;code&gt;;&lt;/code&gt;, &lt;code&gt;{&lt;/code&gt;, or &lt;code&gt;}&lt;/code&gt; or it might be that you forgot to use a &lt;code&gt;:&lt;/code&gt;, &lt;code&gt;;&lt;/code&gt;, &lt;code&gt;{&lt;/code&gt;, or &lt;code&gt;}&lt;/code&gt; when it was required.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Remember, computers are &lt;span&gt;stupid.&lt;/span&gt; They have no more intelligence than the tables they sit on. They don't know when you &lt;span&gt;meant&lt;/span&gt; to include a code snippet like a &lt;code&gt;;&lt;/code&gt; or a &lt;code&gt;}&lt;/code&gt;, and they won't fix it for you.&lt;/p&gt;
						&lt;p&gt;Anyway, back to it.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;External Stylesheets&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;External stylesheets (sometimes called &lt;em&gt;embedded&lt;/em&gt; stylesheets) are considered the best way to handle your CSS. There's a very simple reason for this: when you're managing a site of, say, 100 pages, all controlled by a single stylesheet, and you want to change your link colors from blue to green, it's a lot easier to make the change in your CSS file and let the changes "cascade" throughout all 100 pages than it is to go into 100 separate pages and make the same change 100 times. External stylesheets also reduce the amount of Web page code, which makes it easier for Google and other search engines to find your page's content and give your page a higher ranking. And, since browsers &lt;span title="temporary memory storage that holds recently downloaded Web pages"&gt;cache&lt;/span&gt; the external stylesheet, your pages load faster. Unless your site has a fundamentally different set of styles on its different pages, you should opt for the external stylesheet. This is definitely &lt;span&gt;best practice.&lt;/span&gt;&lt;/p&gt;
						&lt;p&gt;Add an external stylesheet by using the &lt;code&gt;link&lt;/code&gt; HTML attribute. This is the command I use in these pages:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;css/stylesheet.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot;&amp;gt;&lt;/pre&gt;
						&lt;p&gt;This tells the browser to look in the &lt;code&gt;css&lt;/code&gt; folder to find the &lt;code&gt;stylesheet.css&lt;/code&gt; file, and apply it to the page.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Internal Stylesheets&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Internal stylesheets (sometimes called "embedded" stylesheets) are not, technically, "stylesheets," but "inline style blocks." Either way, they go in the head of the individual HTML page and control only that one page. We used that as the way to code your first page in these lessons, for the simple reason that it was easier to go back and forth within the same page to make changes than go back and forth between separate files. Internal stylings override styles from external stylesheets.&lt;/p&gt;
						&lt;p&gt;You can add an inline style block to the &lt;code&gt;head&lt;/code&gt; of your HTML page like so:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;

... add style attributes and so forth here ...

&amp;lt;/style&amp;gt;&lt;/pre&gt;
						&lt;p&gt;&lt;a href="http://www.456bereastreet.com/lab/developing_with_web_standards/css/" title="CSS"&gt;Roger Johannson explicitly recommends &lt;em&gt;not&lt;/em&gt; using internal style blocks&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;This should also be avoided, since it is best to keep HTML and CSS in separate files.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;I'm not as strict about insisting on not using internal style blocks as Roger, but then again, I'm not the expert he is.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Use of CDATA in Internal Stylesheets&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Sometimes you will see the &lt;span title="stands for Character Data"&gt;CDATA&lt;/span&gt; character string used in the HTML code for an internal stylesheet, as such:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;
   /* &amp;lt;![CDATA[ */

... add style attributes and so forth here ...

   /* ]]&amp;gt; /*
&amp;lt;/style&amp;gt;&lt;/pre&gt;
						&lt;p&gt;While this may be useful in XHTML documents, HTML parsers do not recognize the CDATA elements, and therefore shouldn't be used in your HTML documents. (In fact, you'll notice that the CDATA code strings are commented out with the /* */ CSS comment codes, so that HTML documents won't "see" them.)&lt;/p&gt;
						&lt;p&gt;My friend Tommy Olsson &lt;a href="http://www.sitepoint.com/forums/showthread.php?t=574817" title="Need help understanding CDATA"&gt;explains&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;A CDATA-section is normally used for content that contains a lot of &amp;#39;special&amp;#39; characters (like &amp;#39;&amp;gt;&amp;#39; and &amp;#39;&amp;amp;&amp;#39;) that normally need to be escaped. Most browsers only support CDATA-sections for XML documents (including XHTML served as real XHTML, but not &lt;span title="Tommy is referring to browsers such as IE that improperly display XHTML as HTML"&gt;pretend-XHTML served as HTML&lt;/span&gt;). As far as I know, Opera is the only browser that supports CDATA-sections in HTML.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;In the same forum thread, fellow Web expert Stephen Chapman notes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;That CDATA tag is commented out so that the XHTML validator sees it but the web browsers do not. ... If you are using an HTML doctype rather than trying to pretend that your page is XHTML then just remove the entire comments. If you are using real XHTML then remove the /* and */ from around each and leave the CDATA tag in place ....&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Unless you decide to begin coding in XHTML, don't bother with it.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Inline Styling&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Inline styling formats individual blocks of HTML. I've almost never used this, and I doubt you will very often either, though admittedly there are certain situations where you would use inline styling. (Side note: I am actually using a good bit of inline styling in these &lt;strong&gt;Principles&lt;/strong&gt; pages, for one-time examples of various effects and capabilities.) Here's an example of inline styling for a paragraph:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;p style=&amp;quot;color: blue; font-family: Arial;&amp;quot;&amp;gt;&lt;/pre&gt;
						&lt;p&gt;This codes that one single paragraph as displaying in blue and in the font Arial. Nothing else on the page is affected.&lt;/p&gt;
						&lt;p&gt;Inline styling overrides external and internal styles, so if you do use it, it will impose its styling on whatever else you've done with CSS for that text block.&lt;/p&gt;
						&lt;p&gt;Also notice that in inline styling, we only use quotation marks at the very beginning and the very end of the style elements. When the browser sees that second quotation mark, it interprets it as bringing the inline styling to a close.&lt;/p&gt;
						&lt;pre&gt;&amp;lt;p style=&amp;quot;color: &amp;quot;blue&amp;quot;; font-family: &amp;quot;Arial&amp;quot;;&amp;quot;&amp;gt; &lt;span&gt;wrong!&lt;/span&gt;&lt;/pre&gt;
						&lt;p&gt;This will not work!&lt;/p&gt;
						&lt;p&gt;&lt;span&gt;Note:&lt;/span&gt; Microsoft will tell you that programs such as &lt;span title="Microsoft&amp;#39;s word processor"&gt;Word&lt;/span&gt; and &lt;span title="Microsoft&amp;#39;s desktop publishing program"&gt;Publisher&lt;/span&gt; will "create" HTML pages formatted with CSS. They will — using thousands of lines of inline style commands, repeated over and over and over again. It's semantically disastrous, hard on the browser, creates conflicts within the page, and in general is just plain awful. And Microsoft isn't the only firm that creates these kinds of programs. Use word processors and desktop publishers to create the documents that they were designed to make, not Web pages.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.456bereastreet.com/lab/developing_with_web_standards/css/" title="CSS"&gt;Johannson also recommends against using inline styling&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;This should be avoided since it mixes structure and presentation.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;And &lt;a href="http://www.catswhocode.com/blog/top-10-best-practices-for-front-end-web-developers" title="Top 10 best practices for front-end web developers"&gt;Jean-Baptiste Jung&lt;/a&gt; says:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;[T]he style attribute is bad practice, that goes completely against the CSS philosophy.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Same caveat as above: I'm not as strict about insisting on not using internal styling as those guys, but they are the experts, I am not.&lt;/p&gt;
						&lt;p&gt;XHTML 1.1 &lt;span title="rendered obsolete"&gt;deprecates&lt;/span&gt; inline styling. Just so you know; since we aren't coding in XHTML, it won't affect us.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Linking Multiple External Stylesheets&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;It's also possible to link multiple external stylesheets to a single page. In that case, the one lowest in the page will override earlier sheets.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Importing Stylesheets&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;&lt;span&gt;Note:&lt;/span&gt; There's yet another way to link stylesheets to Web pages: the &lt;span&gt;@import&lt;/span&gt; method. I've read through and taken part in a number of discussions about this technique on the SitePoint forums, and my conclusion is, although it's certainly legitimate, there's just no reason for you to use this method of linking your stylesheet over the regular method described above. Certainly a beginning designer won't bother with it. However, I'll show you how it's done, and you can do your own research.&lt;/p&gt;
						&lt;pre&gt;&amp;lt;style type=&amp;quot;text/css&amp;quot; media=&amp;quot;all&amp;quot;&amp;gt;
   @import &amp;quot;style.css&amp;quot;;
   @import &amp;quot;advanced.css&amp;quot;;
&amp;lt;/style&amp;gt;&lt;/pre&gt;
						&lt;p&gt;This example imports two separate stylesheets, &lt;code&gt;style.css&lt;/code&gt; and &lt;code&gt;advanced.css&lt;/code&gt;. Sometimes designers use the &lt;span&gt;@import&lt;/span&gt; method to &lt;a href="http://webdesign.about.com/od/beginningcss/f/css_import_link.htm" title="About.com page on the difference between import and link"&gt;hide a particular stylesheet from older browsers&lt;/a&gt; (which don't recognize the &lt;span&gt;@import&lt;/span&gt; command), and to manage large numbers of stylesheets in a single block of code — sometimes a useful technique for large corporate or academic sites, for example. The drawback is that using the &lt;span&gt;@import&lt;/span&gt; can cause your page to display, briefly, in a completely unstyled appearance — the irritating &lt;a href="http://www.bluerobot.com/web/css/fouc.asp/" title="BlueRobot on the FOUC"&gt;FOUC&lt;/a&gt;, or "flash of unstyled content" phenomenon. Primarily this happens with Internet Explorer. There's a way around this; check the linked BlueRobot page for details. Or better yet, until you have a reason to do so, don't bother with the &lt;span&gt;@import&lt;/span&gt; command.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.catswhocode.com/blog/top-10-best-practices-for-front-end-web-developers" title="Top 10 best practices for front-end web developers"&gt;Jean-Baptiste Jung&lt;/a&gt; writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;While it works, the @import directive is much slower than the other way to include stylesheets into a html document ... It will not make a difference on low traffic websites, but if you have the chance to own a popular website, don't waste your visitor's time using @import.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/html_valid.png" alt="html icon" title="html icon"&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Linking Your External Stylesheet to Your HTML Page&lt;/em&gt;&lt;/p&gt;							
						&lt;p&gt;To link your external stylesheet to your page, include this in the &lt;span&gt;head&lt;/span&gt; of your HTML page:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;css/mystyles.css&amp;quot;&lt;br&gt;media=&amp;quot;screen&amp;quot;&amp;gt;&lt;/pre&gt;
						&lt;p&gt;This assumes that you've created a &lt;code&gt;css&lt;/code&gt; folder for your stylesheet, and you've named it &lt;code&gt;mystyles.css&lt;/code&gt;.&lt;/p&gt;
						&lt;p&gt;The &lt;code&gt;rel&lt;/code&gt; attribute stands for the file's &lt;strong&gt;rel&lt;/strong&gt;ationship to the rest of the page, and the &lt;code&gt;type&lt;/code&gt; shows that it's a text file acting as a CSS stylesheet.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;Media Types&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;When you use an external stylesheet, you should tell the computer what kind of &lt;em&gt;media devices&lt;/em&gt; that stylesheet will support. "Huh?" you may ask, "it supports the computer, duh ..." Well, there's more to it.&lt;/p&gt;
						&lt;p&gt;We're talking about the &lt;code&gt;media&lt;/code&gt; attribute. It's an HTML attribute, but is associated with stylesheets.&lt;/p&gt;
						&lt;p&gt;The most common media device that is supported by a stylesheet is the desktop, laptop, or notebook computer. (So your "duh!" is somewhat validated!) In CSS-speak, that's called a "screen" device. Other devices are printers, mobile devices, projection screens, and a whole raft of assistive technologies. (&lt;a href="http://www.w3.org/TR/CSS2/media.html" title="W3C Media Types"&gt;The W3C site gives a complete list of the media types stylesheets support&lt;/a&gt;. And Ian Lloyd warns us that &lt;a href="http://reference.sitepoint.com/html/link/media" title="media (HTML attribute)"&gt;using some of the lesser-known media attributes in your site could prove troublesome&lt;/a&gt;.)&lt;/p&gt;
						&lt;p&gt;What does all of this mean in the real world?&lt;/p&gt;
						&lt;p&gt;For general purposes, you can get away with two separate stylesheet distinctions: &lt;code&gt;screen&lt;/code&gt; and &lt;code&gt;print&lt;/code&gt;. Like so:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;css/stylesheet.css&amp;quot; &lt;br&gt;type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot;&amp;gt;&lt;/pre&gt;
						&lt;pre&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;css/printstyle.css&amp;quot; &lt;br&gt;type=&amp;quot;text/css&amp;quot; media=&amp;quot;print&amp;quot;&amp;gt;&lt;/pre&gt;
						&lt;p&gt;That means you're going to need TWO stylesheets, one for screen displays (what you're probably using to view this site right now), and one for printing. Fortunately, the link below can help you with designing your print stylesheet. It's not as tough as you might think.&lt;/p&gt;
						&lt;p&gt;If you have a small site not particularly suitable for printing, or you're just that lazy, you can use the default setting of &lt;code&gt;all&lt;/code&gt;:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;css/stylesheet.css&amp;quot; &lt;br&gt;type=&amp;quot;text/css&amp;quot; media=&amp;quot;all&amp;quot;&amp;gt;&lt;/pre&gt;
						&lt;p&gt;It's not considered &lt;span&gt;best practice&lt;/span&gt; to just omit the &lt;code&gt;media&lt;/code&gt; attribute entirely, though some people do. Some people also bungee-jump into asphalt parking lots.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;Creating "Print" Stylesheets&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;People will, sooner or later, print your Web page for their own use. If you don't create a print stylesheet, the browser's default will determine what the page looks like, and it usually isn't pretty. Do your users the courtesy of giving them a proper print stylesheet. They dramatically increase the usability of your site.&lt;/p&gt;
						&lt;p&gt;While there are numerous ways to format a print stylesheet, I've used these pages as my primary sources for this walkthrough:&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;&lt;a href="http://www.alistapart.com/articles/goingtoprint/" title="Going to Print"&gt;A List Apart's "Going to Print"&lt;/a&gt;&lt;/li&gt;
							&lt;li&gt;&lt;a href="http://www.webcredible.co.uk/user-friendly-resources/css/print-stylesheet.shtml" title="Print stylesheet - the definitive guide"&gt;Webcredible's "Print stylesheet — the definitive guide"&lt;/a&gt;&lt;/li&gt;
							&lt;li&gt;&lt;a href="http://webdesign.about.com/cs/css/a/aa042103a.htm" title="CSS Media Types Create Print-Friendly Pages"&gt;About.com's "CSS Media Types Create Print-Friendly Pages"&lt;/a&gt;&lt;/li&gt;
							&lt;li&gt;&lt;a href="http://www.tech-evangelist.com/2008/09/15/formatting-printed-web-pages/" title="Formatting Printed Web Pages With CSS"&gt;Tech-Evangelist's "Formatting Printed Web Pages with CSS"&lt;/a&gt;&lt;/li&gt;
						&lt;/ul&gt;
						&lt;blockquote&gt;&lt;p&gt;I am amazed at the number of major web sites whose pages cannot be printed properly because the content either doesn’t fit on the page, or is cluttered with ads and menus that have no useful purpose on a printed page. — Tech-Evangelist&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Of course, providing a proper print stylesheet is &lt;span&gt;best practice&lt;/span&gt; for Web design.&lt;/p&gt;
						&lt;p&gt;Your print stylesheet works with your main stylesheet. You don't have to create an entirely new stylesheet, just make some changes to what you already have.&lt;/p&gt;
						&lt;p&gt;A good print stylesheet does the following:&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;Change colors to black on white.&lt;/li&gt;
							&lt;li&gt;Change the font to serif.&lt;/li&gt;
							&lt;li&gt;Change the font size (if needed).&lt;/li&gt;
							&lt;li&gt;Underline all links.&lt;/li&gt;
							&lt;li&gt;Remove non-essential images.&lt;/li&gt;
							&lt;li&gt;Remove navigation.&lt;/li&gt;
							&lt;li&gt;Remove most or all of the advertising.&lt;/li&gt;
							&lt;li&gt; Remove all JavaScript, Flash, and animated images.&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;Start by adding a second stylesheet declaration to your HTML page. Let's say your original stylesheet is named &lt;code&gt;style.css&lt;/code&gt;. Now add &lt;code&gt;print.css&lt;/code&gt; to the page:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;/css/style.css&amp;quot; type=&amp;quot;text/css&amp;quot; &lt;br&gt;media=&amp;quot;screen&amp;quot;&amp;gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;/css/print.css&amp;quot; type=&amp;quot;text/css&amp;quot; &lt;br&gt;media=&amp;quot;print&amp;quot;&amp;gt;&lt;/pre&gt;
						&lt;p&gt;Notice that the &lt;code&gt;media&lt;/code&gt; attribute changes, from &lt;code&gt;screen&lt;/code&gt; to &lt;code&gt;print&lt;/code&gt;. This tells your browser to use the first one for display on a computer monitor, and the second one for a printer. &lt;em&gt;Make sure your print stylesheet is &lt;strong&gt;second&lt;/strong&gt; in line behind the main stylesheet!&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html#" title="media attributes"&gt;More about &lt;em&gt;media attributes&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Now just copy your main stylesheet (&lt;code&gt;style.css&lt;/code&gt; in our example) to a blank text file and save it as &lt;code&gt;print.css&lt;/code&gt;. Now that you've done that, we can begin to change it around to suit your printing needs. The new &lt;code&gt;print.css&lt;/code&gt; sheet will be much simpler and shorter than the main stylesheet.&lt;/p&gt;
						&lt;p&gt;In the new stylesheet, set your entire site's width to 100%. This will be the first command on the new sheet.&lt;/p&gt;
						&lt;pre&gt;html {
   width: 100%;
}&lt;/pre&gt;
						&lt;p&gt;We're going to move from &lt;code&gt;pixels&lt;/code&gt; to &lt;code&gt;points&lt;/code&gt; to control the size of the printed text. Pixels are used for electronic displays, but don't work well for printed output. Conversely, points don't work well for electronic displays, but work nicely for handling print sizing.&lt;/p&gt;
						&lt;p&gt;Set the body width to seven inches. That ensures that everything printed on the page will fit on a standard (8 inches wide) piece of printer paper. We're also going to set the background color to white, the color of the fonts to black, and the base size of the fonts to 12 points.&lt;/p&gt;
						&lt;pre&gt;body {
   width: 7in;
   background-color: #fff;
   color: #000;
   font-size: 12pt;
   letter-spacing: normal;
}&lt;/pre&gt;
						&lt;p&gt;In the width measured in inches, we're actually using points here: 7 inches equals 504 points. We could have just as easily written the CSS code this way:&lt;/p&gt;
						&lt;pre&gt; body {
   width: 504pts;
}&lt;/pre&gt;
						&lt;p&gt;The conversion factor is: 1 inch = 72 points.&lt;/p&gt;
						&lt;p&gt;Some sites recommend that you have your page print in a serif font suitable for printing, say Times (for Mac and Linux users) or Times New Roman (for everyone else). Other sites warn you that having your printed site appear in a font different from the display font may surprise users. It's your call. If you want to have the font print in a print-friendly serif, add this to the &lt;code&gt;body&lt;/code&gt; selector:&lt;/p&gt;
						&lt;pre&gt;font-family: Times, "Times New Roman", serif;&lt;/pre&gt;
						&lt;p&gt;The &lt;code&gt;letter-spacing: normal&lt;/code&gt; selector returns the letter spacing to normal, if you've changed it around on your sheet. You might not need this one now, but it won't hurt and might be useful when you modify your stylesheet.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html" title="Web Design Principles Fonts"&gt;More information about &lt;em&gt;fonts&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Another good thing is to ensure that your images don't have borders around them. This is another addition that may well not be necessary for your page, but it won't hurt to add it:&lt;/p&gt;
						&lt;pre&gt;img {
   border: 0px;
}&lt;/pre&gt;
						&lt;p&gt;Your page probably has a good number of hyperlinks. Obviously they won't work on paper, but if it's important to have them printed (for reference, etc), here's how to have them print with descriptive text &lt;em&gt;and&lt;/em&gt; URLs (what good is a hyperlinked chunk of text without its URL for us to see?).&lt;/p&gt;
						&lt;p&gt;To have the descriptive text print:&lt;/p&gt;
						&lt;pre&gt;a:link, a:visited {
   color: #520;
   background: transparent;
   font-weight: bold;
   text-decoration: underline;
}&lt;/pre&gt;
						&lt;p&gt;With this CSS code, your page's hyperlinks will show up in a dark red, good enough to appear legibly in both a color and a &lt;span title="range of shades of gray without apparent color"&gt;grayscale&lt;/span&gt; output, with the additions of boldface and underlining to help the text of the links stand out.&lt;/p&gt;
						&lt;p&gt;Modern browsers will allow you to insert the URLs of the links after the text. It assumes that the text of your page's body is contained in a &lt;code&gt;#content&lt;/code&gt; ID; you will, of course, need to change this to reflect your own CSS layout. (If you add it to your &lt;code&gt;body&lt;/code&gt; selector, a URL will appear in the header upon printout, an effect you may want to avoid.)&lt;/p&gt;
						&lt;pre&gt;#content a:link:after, #content a:visited:after {
   content: " (" attr(href) ") ";
   font-size: 90%;
}&lt;/pre&gt;
						&lt;p&gt;&lt;span&gt;Note:&lt;/span&gt; the spacing in the above code is &lt;em&gt;very important&lt;/em&gt;. Don't change it around.&lt;/p&gt;
						&lt;p&gt;Now go through your stylesheet. Note any elements you don't want to print, such as headers, footers, sidebars, advertisements, search boxes, navigation menus, etc. Make sure they are all referenced by either a class or ID. If they're not, give them one, but don't style it in the main stylesheet. One good method is again from Tech-Evangelists, and recommends giving each of the unnamed elements that you don't want printed the class of &lt;code&gt;.nopr&lt;/code&gt; — standing for "no print."&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html" title="Web Design Principles Classes and IDs"&gt;More about &lt;em&gt;classes and IDs&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Now give all of these elements a single attribute: &lt;code&gt;display: none&lt;/code&gt;.&lt;/p&gt;
						&lt;p&gt;Here's an example:&lt;/p&gt;
						&lt;pre&gt;.nopr, #footer a, #header, #navbar, .soclinks, #searchbox, #sidebar {
   display: none;
}&lt;/pre&gt;
						&lt;p&gt;Because of the &lt;code&gt;display: none&lt;/code&gt; attribute and value, none of these will display when your page is formatted for printing.&lt;/p&gt;
						&lt;p&gt;If you want to prevent all elements within a table column or CSS division from displaying, simply add an asterisk. Like this:&lt;/p&gt;
						&lt;pre&gt;#sidebar *&lt;/pre&gt;
						&lt;p&gt;Any elements that remain (say, &lt;code&gt;#content&lt;/code&gt;) should be coded to make sure that all of their content appears on the page — no running off the page. Add this to the selectors. We'll use &lt;code&gt;#content&lt;/code&gt; as our example:&lt;/p&gt;
						&lt;pre&gt;   width: 100%;
   margin: 0;
   float: none;&lt;/pre&gt;
						&lt;p&gt;If you have elements that display in a lighter color, say a header in your sidebar that displays in white, change it so it prints in black. Here's an example:&lt;/p&gt;
						&lt;pre&gt;#sidebar h2 {
   color: #000;
}&lt;/pre&gt;
						&lt;p&gt;Check your page's layout for your printer, not by printing each page, but by going through your browser's Print Preview function. Make whatever tweaks are necessary.&lt;/p&gt;
						&lt;p&gt;Eric Meyer, one of the leading proponents of CSS, wrote &lt;a href="http://www.alistapart.com/articles/goingtoprint/" title="CSS Design: Going to Print"&gt;a seminal article for A List Apart on printing your pages&lt;/a&gt; back in 2002. It is still an excellent reference today, and, as noted above, one I've borrowed from extensively for this section. A List Apart's Derek Featherstone gives us &lt;a href="http://www.alistapart.com/articles/printyourway/" title="Print It Your Way"&gt;a much more sophisticated way of formatting our print pages&lt;/a&gt;. WestCiv's &lt;a href="http://www.westciv.com/style_master/academy/css_tutorial/advanced/printing.html" title="Printing"&gt; "Printing"&lt;/a&gt; is another interesting take on print stylesheets. And &lt;a href="http://37signals.com/svn/posts/554-little-css-print-stylesheet-tip" title="Little CSS print stylesheet tip"&gt;37signals&lt;/a&gt; provides an interesting visual take on the results of their print stylesheet.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275194000505"><id gr:original-id="">tag:google.com,2005:reader/item/c4fc0b993be6780a</id><title type="html">History of CSS » Best Practices HTML and CSS</title><published>2010-05-30T04:33:20Z</published><updated>2010-05-30T04:33:20Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinhistory.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinhistory.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinhistory.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;History of CSS&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/oldbook.jpg" alt="man holding old book" title="illustrative graphic of man holding old book"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;Some guides to learning more about the history of CSS.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;Following the light of the sun, we left the Old World. — &lt;a href="http://www.brainyquote.com/quotes/quotes/c/christophe100795.html" title="Quote from BrainyQuote"&gt;Christopher Columbus&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;p&gt;Ross Shannon gives &lt;a href="http://www.yourhtmlsource.com/stylesheets/introduction.html" title="Stylesheets"&gt;a good thumbnail history of &lt;span title="Cascading Style Sheets"&gt;CSS&lt;/span&gt; here&lt;/a&gt;. Want to learn more? You might be interested to read &lt;a href="http://www.w3.org/Style/LieBos2e/history/" title="The CSS saga"&gt;The CSS saga&lt;/a&gt; and &lt;a href="http://virtuelvis.com/archives/2005/01/css-history" title="Who created CSS CSS Early History"&gt;Who created CSS? CSS Early History&lt;/a&gt;. These links will introduce you to seminal figures like Håkon Wium Lie, Pei Wei, Dave Raggett, and Bert Bos, the battle over how presentational control should be divided between user agents (browsers), designers, and end users, the Microsoft-Netscape wars, Netscape's attempt to replace CSS with JavaScript, and Microsoft's game-changing embrace of CSS in IE 5 for the Mac. Fun reads all.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275193977925"><id gr:original-id="">tag:google.com,2005:reader/item/249e083a8b88a097</id><title type="html">CSS Crib Sheet » Best Practices HTML and CSS</title><published>2010-05-30T04:32:57Z</published><updated>2010-05-30T04:32:57Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;CSS Crib Sheet&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/cheatsheet.jpg" alt="cheat sheets" title="illustrative cheat sheets"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;A 'cheat sheet' for CSS usage&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;No, we don't cheat. And even if we did, I'd never tell you. — &lt;a href="http://www.brainyquote.com/quotes/quotes/t/tommylasor139455.html" title="Quote from BrainyQuote"&gt;Tommy Lasorda&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;p&gt;Mezzoblue's Dave Shea gives us an extremely useful &lt;a href="http://www.mezzoblue.com/css/cribsheet/" title="CSS Crib Sheet"&gt;CSS Crib Sheet&lt;/a&gt;. I'll give you a shortened version of Shea's list below, along with some additions from &lt;a href="http://www.456bereastreet.com/lab/developing_with_web_standards/css/" title="CSS"&gt;Roger Johannson&lt;/a&gt;. Some of the tips Shea and Johannson give us may not make sense to you yet, but keep the crib sheet handy; you will refer to it again and again, and you'll eventually learn why these guys say what they're saying.&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;&lt;em&gt;When in doubt, validate.&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="Validation"&gt;validation&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Build and test your CSS in the most advanced browser available before testing in others, not after.&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="browsers"&gt;browsers&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;When relying on floats for layouts, make sure they clear properly.&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="floats"&gt;floats&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Margins collapse; apply padding or a border to avoid.&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="margins and padding"&gt;margins and padding&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Try to avoid applying padding/borders and a fixed width to an element.&lt;/em&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Avoid the Flash of Unstyled Content in IE.&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="importing stylesheets"&gt;importing stylesheets&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Don't rely on min-width in IE.&lt;/em&gt;&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;When in doubt, decrease widths.&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="widths"&gt;&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Content not showing up properly in IE? Check the Peekaboo bug.&lt;/em&gt; More about &lt;a href="http://www.positioniseverything.net/explorer/peekaboo.html" title="peekaboo bug in IE"&gt;&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Be careful when styling links if you're using anchors.&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="using IDs in anchors"&gt;using IDs in anchors&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Make sure your desired effect actually exists.&lt;/em&gt; (Shea is referring to non-standard CSS effects.)&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Divide and Conquer: use commenting to turn off large sections of style.&lt;/em&gt; (Nifty trick for debugging stylesheets.)&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Remember 'LoVe/HAte' linking.&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="ordering anchors"&gt;ordering anchors&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Remember 'TRouBLEd' borders.&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="borders"&gt;borders&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Specify units for non-zero values.&lt;/em&gt;&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Test different font sizes.&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="fonts"&gt;fonts&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;With stylesheets, test embedded (internal); launch imported (external).&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="external stylesheets"&gt;external stylesheets&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Add obvious borders to help debug layouts.&lt;/em&gt;&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Don't use single quotation marks around paths for images.&lt;/em&gt;&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Don't link to empty stylesheets as 'placeholders' for future stylesheets (like handheld or print media style sheets).&lt;/em&gt;&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Understand the CSS box model.&lt;/em&gt; More about &lt;a href="http://www.456bereastreet.com/archive/200612/internet_explorer_and_the_css_box_model/" title="the box model"&gt;the box model&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Use only allowed characters for class and id.&lt;/em&gt; More about &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princrib.html#" title="IDs and classes"&gt;IDs and classes&lt;/a&gt;.&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princribprint.html" title="Printable version of the CSS Crib Sheet"&gt;Printable version of the CSS Crib Sheet&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275193594589"><id gr:original-id="">tag:google.com,2005:reader/item/6dea907e4e32dd68</id><title type="html">Inheritance » Best Practices HTML and CSS</title><published>2010-05-30T04:26:34Z</published><updated>2010-05-30T04:26:34Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prininherit.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prininherit.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prininherit.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Inheritance&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/pchild.jpg" alt="" title=""&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;How "child" elements "inherit" the characteristics of their "parents."&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;We inherit nothing truly, but what our actions make us worthy of. — &lt;a href="http://www.brainyquote.com/quotes/quotes/g/georgechap383448.html" title="Quote from BrainyQuote"&gt;George Chapman&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prininherit.html#child" title="Parent-Child Relationships in CSS"&gt;Parent-Child Relationships in CSS&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;One of the concepts behind the idea of the &lt;em&gt;cascading&lt;/em&gt; stylesheet is &lt;em&gt;inheritance.&lt;/em&gt; The top-level element of any HTML page is its &lt;code&gt;body&lt;/code&gt;; many designers use this as a selector. When you apply an attribute to the &lt;code&gt;body&lt;/code&gt; selector, the other, lower-level elements &lt;em&gt;inherit&lt;/em&gt; the attribute. Like this:&lt;/p&gt;
						&lt;pre&gt;body {
   color: blue;
}&lt;/pre&gt;
						&lt;p&gt;With this &lt;code&gt;color: blue;&lt;/code&gt; attribute and value assigned to everything within the &lt;code&gt;body&lt;/code&gt; selector, all the text in your site will appear in blue. This is because of CSS inheritance.&lt;/p&gt;
						&lt;p&gt;However, if you add the same attribute, and a different value, to a &lt;em&gt;child&lt;/em&gt; element such as an &lt;code&gt;h1&lt;/code&gt;, that particular element will appear differently.&lt;/p&gt;
						&lt;p&gt;Like this:&lt;/p&gt;
						&lt;pre&gt;h1 {
   color: red;
}&lt;/pre&gt;
						&lt;p&gt;In this case, every text element within the &lt;code&gt;body&lt;/code&gt; element &lt;em&gt;except&lt;/em&gt; the &lt;code&gt;h1&lt;/code&gt; element will appear in blue. The &lt;code&gt;h1&lt;/code&gt; element will appear in red. This is a further example of inheritance.&lt;/p&gt;
						&lt;p&gt;Inline elements such as the HTML tag &lt;code&gt;em&lt;/code&gt; can also be styled. Normally, this line of code would only make the emphasized word appear in italics, while the previous styling (the red color) would remain:&lt;/p&gt;
&lt;pre&gt;&amp;lt;h1&amp;gt; some &amp;lt;em&amp;gt;emphasized&amp;lt;/em&amp;gt; text&amp;lt;/h1&amp;gt;&lt;/pre&gt;
						&lt;p&gt;However, you can add styling to the particular HTML element that, because of inheritance, would override the earlier red coloring:&lt;/p&gt;
						&lt;pre&gt;em {
   color: green;
}&lt;/pre&gt;
						&lt;p&gt;Now, the &lt;code&gt;h1&lt;/code&gt; would still appear in blue, except for the &lt;code&gt;em&lt;/code&gt;, which is now styled to appear in green.&lt;/p&gt;
						
						&lt;p&gt;&lt;strong&gt;Parent-Child Relationships in CSS&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;The idea of "parent-child" relationships in CSS grows directly from the concept of inheritance.&lt;/p&gt;
						&lt;p&gt;Just as a child inherits eye color and other traits from a parent, a "child" element will inherit styling from a "parent" element.&lt;/p&gt;
						&lt;p&gt;Try to get used to reading about "parent" and "child" elements in CSS, as it's a commonly used metaphor.&lt;/p&gt;
						&lt;p&gt;Child elements are contained by parent elements. Therefore, they inherit their properties. &lt;/p&gt;
						&lt;p&gt;Let's say you have a parent &lt;code&gt;div&lt;/code&gt; and a child &lt;code&gt;p&lt;/code&gt; within that &lt;code&gt;div&lt;/code&gt;.&lt;/p&gt;
						&lt;p&gt;Your HTML might look something like this:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div class=&amp;quot;foo&amp;quot;&amp;gt;
   &amp;lt;p&amp;gt;Stuff.&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;In your stylesheet, you might decide that everything in that &lt;code&gt;div&lt;/code&gt; needs to be red. So here's your CSS:&lt;/p&gt;
						&lt;pre&gt;.foo {
   color: #ff0000;
}&lt;/pre&gt;
						&lt;p&gt;Adding that style to your stylesheet means that the paragraph contained inside the "foo" &lt;code&gt;div&lt;/code&gt; will be red, without your needing to add the &lt;code&gt;color: #ff0000;&lt;/code&gt; selector to that paragraph.&lt;/p&gt;
						&lt;p&gt;When you find yourself griping, "I made &lt;em&gt;one single change&lt;/em&gt; to my stylesheet and now &lt;em&gt;everything&lt;/em&gt; looks different!", a basic grasp of the "parent-child" concept will often rescue you.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275193097440"><id gr:original-id="">tag:google.com,2005:reader/item/b927819939a76e3c</id><title type="html">CSS Selectors, Attributes, and Values » Best Practices HTML and CSS</title><published>2010-05-30T04:18:17Z</published><updated>2010-05-30T04:18:17Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princsssel.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princsssel.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princsssel.html#nogo"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;CSS Selectors, Attributes, and Values&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/techdraw.jpg" alt="technical drawing" title="illustrative technical drawing"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;The functions of CSS selectors, attributes, and values.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;But one of the attributes of love, like art, is to bring harmony and order out of chaos, to introduce meaning and affect where before there was none, to give rhythmic variations, highs and lows to a landscape that was previously flat. — &lt;a href="http://thinkexist.com/quotes/molly_haskell/" title="Quote from ThinkExist"&gt;Molly Haskell&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princsssel.html#types" title="Selectors Types"&gt;Selectors Types&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princsssel.html#group" title="Grouping Selectors"&gt;Grouping Selectors&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princsssel.html#context" title="Contextual Selectors"&gt;Contextual Selectors&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princsssel.html#cascade" title="Cascading Order"&gt;Cascading Order&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princsssel.html#lower" title="Lower Case"&gt;Using Lower Case in CSS&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;You should know the proper terminology for the different parts of your stylesheet. Of all places, the &lt;a href="http://www.microsoft.com/typography/web/designer/css02.htm" title="CSS terminology "&gt;Microsoft Web site&lt;/a&gt; gives us some invaluable assistance in learning the proper names of different CSS components. The page is old and hasn't been updated in a long while, but the information itself is solid. Two more up-to-date references are Ian Lloyd's &lt;a href="http://www.sitepoint.com/books/html2/" title="Build Your Own Web Site The Right Way"&gt;Build Your Own Web Site The Right Way Using HTML &amp;amp; CSS&lt;/a&gt;, and Rachel Andrew's &lt;a href="http://www.sitepoint.com/books/cssant3/" title="The CSS Anthology"&gt;The CSS Anthology: 101 Essential Tips, Tricks &amp;amp; Hacks&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;CSS elements can be broken down by &lt;em&gt;rule&lt;/em&gt;, &lt;em&gt;selector&lt;/em&gt;, &lt;em&gt;declaration&lt;/em&gt;, &lt;em&gt;property&lt;/em&gt;, and &lt;em&gt;value&lt;/em&gt;.&lt;/p&gt;
						&lt;p&gt;This is an entire &lt;em&gt;rule&lt;/em&gt; (sometimes called a &lt;em&gt;style declaration&lt;/em&gt;):&lt;/p&gt;
						&lt;pre&gt;p {
   font-size: 10px;
}&lt;/pre&gt;
						&lt;p&gt;A &lt;em&gt;selector&lt;/em&gt; is the HTML tag being styled:&lt;/p&gt;
						&lt;pre&gt;p&lt;/pre&gt;
						&lt;p&gt;The &lt;em&gt;declaration&lt;/em&gt; (sometimes called a &lt;em&gt;declaration block&lt;/em&gt;) is the portion of the CSS rule within the curly brackets:&lt;/p&gt;
						&lt;pre&gt;{
   font-size: 10px;
}&lt;/pre&gt;
						&lt;p&gt;The &lt;em&gt;property&lt;/em&gt; (sometimes called the &lt;em&gt;attribute&lt;/em&gt;) is the particular element that is applied to a selector:&lt;/p&gt;
						&lt;pre&gt;font-size&lt;/pre&gt;
						&lt;p&gt;The &lt;em&gt;value&lt;/em&gt; is the, well, value assigned to a particular property:&lt;/p&gt;
&lt;pre&gt;10px;&lt;/pre&gt;
						&lt;p&gt;Let's say we have this hypothetical command inside your stylesheet:&lt;/p&gt;
						&lt;pre&gt;body {
   font-size: 0.8em;
   color: #ff0000;
}&lt;/pre&gt;
						&lt;p&gt;&lt;a href="http://www.tizag.com/cssT/selector.php" title="CSS Selector"&gt;Tizag.com&lt;/a&gt; writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;"Property" is the CSS element you wish to manipulate and "value" represents the value of the specified property. The selector name creates a direct relationship with the HTML tag you want to edit.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;What does that mean? Well, in our example above, the &lt;code&gt;body&lt;/code&gt; tag (the &lt;code&gt;selector&lt;/code&gt;) is manipulated — modified — by two &lt;code&gt;properties&lt;/code&gt; that change the font size and the color of everything in the body.&lt;/p&gt;
						&lt;p&gt;We use these terms in these pages.&lt;/p&gt;	
						&lt;p&gt;&lt;span&gt;Note:&lt;/span&gt; Some designers write their CSS code all on one line, like this:&lt;/p&gt;
						&lt;pre&gt;body {font-size: 0.8em; color: #ff0000; }&lt;/pre&gt;
						&lt;p&gt;There's nothing wrong with this.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Selector Types&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;There are several types of selectors commonly in use.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Type Selectors&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Basically, a "type selector" styles every instance of a particular HTML element appearing in the site. For instance:&lt;/p&gt;
						&lt;pre&gt;a {
   color: #ff0000;
}&lt;/pre&gt;
						&lt;p&gt;has every single &lt;code&gt;a&lt;/code&gt; element (essentially, every link) in your site appearing in bright red. Andrew writes: "Type selectors are often used to set the basic styles that will appear throughout a web site." Easy enough, though using type selectors paints with a relatively broad brush.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Class Selectors&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;As noted, type selectors style every instance of a particular element. Maybe you don't want that. Let's say you have a section of your page where you want your links (the &lt;code&gt;a&lt;/code&gt; elements) to appear in a stylish, muted gray instead of that firehouse red you've chosen for other parts of your site. Easy enough, you assign a &lt;em&gt;class&lt;/em&gt;.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html" title="Web Design Principles Classes and IDs"&gt;More about &lt;em&gt;classes and IDs&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;We create the following class in our stylesheet:&lt;/p&gt;
						&lt;pre&gt;.subtlelink {
   color: #808080;
}&lt;/pre&gt;
						&lt;p&gt;Now, when we assign that class to a link in our HTML code:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;a href=&amp;quot;http://www.yahoo.com&amp;quot; title=&amp;quot;Yahoo&amp;quot; class=&amp;quot;subtlelink&amp;quot;&amp;gt;Yahoo&amp;lt;/a&amp;gt;&lt;/pre&gt;
						&lt;p&gt;those links, and &lt;em&gt;only&lt;/em&gt; those links, will appear in a nice, subtle gray.&lt;/p&gt;
						&lt;p&gt;&lt;span&gt;Note:&lt;/span&gt; Actually, they will only if you put the &lt;code&gt;.subtlelink&lt;/code&gt; &lt;em&gt;below&lt;/em&gt; (after) the original red-styled links in your stylesheet. &lt;em&gt;Specificity&lt;/em&gt; comes into play here. You'll find out more about specificity later on this page.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;ID Selectors&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Those of us who know these things know that classes and IDs work much alike.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html" title="Web Design Principles Classes and IDs"&gt;More about &lt;em&gt;classes and IDs&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;However, an ID can only appear once on a page, so they are usually used for one particular element on a page.&lt;/p&gt;
						&lt;pre&gt;#navigation a {
   color: #808080;
}&lt;/pre&gt;
						&lt;p&gt;gives us those gray links only inside an HTML element designated as "navigation":&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div class=&amp;quot;navigation&amp;quot;&amp;gt;
   &amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://www.yahoo.com&amp;quot; title=&amp;quot;Yahoo&amp;quot;&amp;gt;Yahoo&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;We can combine ID and class selectors:&lt;/p&gt;
						&lt;pre&gt;#navigation .subtlelink {
   color: #808080;
}&lt;/pre&gt;
						&lt;p&gt;like so:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div id=&amp;quot;navigation&amp;quot;&amp;gt;
   &amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://www.yahoo.com&amp;quot; title=&amp;quot;Yahoo&amp;quot; class=&amp;quot;subtlelink&amp;quot;&amp;gt;Yahoo&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

						&lt;p&gt;&lt;em&gt;Descendant Selectors&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Basically, this means that if you include more than one element inside a styled class (such as our given "subtlelink") or ID, everything gets styled.&lt;/p&gt;
						&lt;p&gt;In other words, this:&lt;/p&gt;
						&lt;pre&gt;#navigation a {
   color: #808080;
}&lt;/pre&gt;
						&lt;p&gt;styles all of these links:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div id=&amp;quot;navigation&amp;quot;&amp;gt;
   &amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://www.yahoo.com&amp;quot; title=&amp;quot;Yahoo&amp;quot;&amp;gt;Yahoo&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
   &amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://www.google.com&amp;quot; title=&amp;quot;Google&amp;quot;&amp;gt;Google&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
   &amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://www.altavista.com&amp;quot; title=&amp;quot;Alta Vista&amp;quot;&amp;gt;Alta Vista&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;A descendant selector is made up of a list of selectors, separated by spaces (very important!) that matches a page element or group of elements &lt;em&gt;from the outside in&lt;/em&gt;. In our example, our page contains a &lt;code&gt;div&lt;/code&gt; that has the ID of &lt;code&gt;navigation&lt;/code&gt;. As a result, &lt;code&gt;#navigation a&lt;/code&gt; refers to all of the &lt;code&gt;a&lt;/code&gt; elements inside the &lt;code&gt;#navigation&lt;/code&gt; &lt;em&gt;div&lt;/em&gt;.&lt;/p&gt;
						&lt;p&gt;Confused yet? I wrote that (under the guidance of Andrew's excellent book) and I'm confused! Trust me, this works.&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Child Selectors&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Lastly, we have &lt;em&gt;child selectors&lt;/em&gt;, which refers to the concept of &lt;em&gt;inheritance&lt;/em&gt;.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prininherit.html" title="Web Design Principles Inheritance"&gt;More about &lt;em&gt;inheritance&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;Andrew defines child selectors thusly: "The descendant selector matches all elements that are descendants of the parent element, including elements that are not direct descendants."&lt;/p&gt;
						&lt;p&gt;Say what? Let's look at an example.&lt;/p&gt;
						&lt;p&gt;Let's use some fresh faux CSS classes, "leftside" and "standout". The "leftside" class will indicate material that will, we trust, appear on the left side of our site, and the "standout" class will apply to text that we want to stand out. And, so I don't have to type so much, let's switch from anchor links to paragraphs in our HTML examples.&lt;/p&gt;
						&lt;p&gt;...more to come...&lt;/p&gt;						
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Grouping Selectors&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Selectors can be grouped together, as long as you separate them with a comma and a space. Instead of:&lt;/p&gt;
						&lt;pre&gt;h1 {
   font-family: Arial, sans-serif;
   color: #fff;
}

h2 {
   font-family: Arial, sans-serif;
   color: #fff;
}

h3 {
   font-family: Arial, sans-serif;
   color: #fff;
}&lt;/pre&gt;
						&lt;p&gt;it's much cleaner and easier to maintain to do this:&lt;/p&gt;
						&lt;pre&gt;h1, h2, h3 {
   font-family: Arial, sans-serif;
   color: #fff;
}&lt;/pre&gt;
						&lt;p&gt;You can also differentiate between your elements, setting different rules for specific elements after setting a rule for a group. In other words, you can do this:&lt;/p&gt;
						&lt;pre&gt;h1, h2, h3 {
   font-family: Arial, sans-serif;
   color: #fff;
}

h1 {
   font-size: 1.5em;
}&lt;/pre&gt;
						&lt;p&gt;In this example, your &lt;code&gt;h1&lt;/code&gt; element will be displayed in Arial, in white (&lt;code&gt;#fff&lt;/code&gt;), and in a 1.5em size. &lt;span&gt;Note:&lt;/span&gt; For this to work, the standalone &lt;code&gt;h1&lt;/code&gt; coding must be &lt;strong&gt;after&lt;/strong&gt; the group coding.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.sitepoint.com/books/html2/" title="Build Your Own Web Site The Right Way"&gt;Lloyd&lt;/a&gt; tells us:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;You can think of the commas in CSS selectors (like the one above) as the word
"or."&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Declarations can also be grouped. In some stylesheets, you will see something like the following:&lt;/p&gt;
						&lt;pre&gt;h1 {
   font-weight: bold;
}

h1 {   
   font-size: 10px;
}

h1 {
   line-height: 12px;
}

h1 {
   font-family: Georgia, serif;
}&lt;/pre&gt;
						&lt;p&gt;Incredibly long-winded. Just combine them, separating each selector with a semicolon:&lt;/p&gt;
						&lt;pre&gt;h1 {
   font-weight: bold; 
   font-size: 10px;
   line-height: 12px;
   font-family: Georgia, serif;
}&lt;/pre&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Contextual Selectors&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;You can classify individual selectors according to their &lt;em&gt;context&lt;/em&gt; — in other words, according to the element you wish them to style. Generally, they override the styling you've added to (for example) your &lt;code&gt;body&lt;/code&gt; element, or the browser's own defaults.&lt;/p&gt;
						&lt;p&gt;Following &lt;a href="http://www.sitepoint.com/books/html2/" title="Build Your Own Web Site The Right Way"&gt;Ian Lloyd&lt;/a&gt;'s lead, I think we can get a pretty good grasp of what this means.&lt;/p&gt;
						&lt;p&gt;Let's say you want to create a class called "highlight." You want it to show its text in italics, and in a different font from the rest of the text.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinfont.html" title="Web Design Principles Fonts"&gt;More about &lt;em&gt;styling your fonts&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;You're only going to use it on certain paragraphs. So you create a &lt;em&gt;contextual selector&lt;/em&gt;:&lt;/p&gt;
						&lt;pre&gt;.highlight p {
   font-style: italic;
   font-family: Georgia, "Times New Roman", serif;
}&lt;/pre&gt;
						&lt;p&gt;By wrapping a paragraph, or a group of paragraphs, in a &lt;code&gt;div&lt;/code&gt; with the &lt;code&gt;highlight&lt;/code&gt; class, you can have those paragraphs appear in your styling:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div class=&amp;quot;highlight&amp;quot;&amp;gt;
   &amp;lt;p&amp;gt;This text is italicized and displays in Georgia.&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiv.html" title="Web Design Principles DIV and SPAN"&gt;More about &lt;em&gt;the DIV and SPAN elements&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;p&gt;That will work great on the designated paragraphs, and other paragraphs will keep the original styling.&lt;/p&gt;
						&lt;p&gt;&lt;span&gt;However, this will &lt;strong&gt;not&lt;/strong&gt; work&lt;/span&gt;:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;p class=&amp;quot;highlight&amp;quot;&amp;gt;This text is supposed to appear in italics and Georgia, but it will not.&amp;lt;/p&amp;gt;&lt;/pre&gt;
						&lt;p&gt;Why not? Because your &lt;code&gt;highlight p&lt;/code&gt; CSS command already names a &lt;code&gt;p&lt;/code&gt; in its selector. By designating a paragraph (a second &lt;code&gt;p&lt;/code&gt;) as containing the class "highlight", you give the browser one too many paragraphs to search for. Your "highlight"-styled paragraph won't display properly.&lt;/p&gt;
						&lt;p&gt;Contextual selectors work with more than paragraphs. Let's say you have a link inside your &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/tut11.html" title="Creating a Navigational Scheme"&gt;navigational scheme&lt;/a&gt;, which you have sensibly ID'd as "navigation." By creating the following in your stylesheet:&lt;/p&gt;
						&lt;pre&gt;#navigation a {
   text-decoration: none;
   color: #ff0000;
}&lt;/pre&gt;
						&lt;p&gt;you've ensured that all the links inside this scheme will have no underline, and will be red in color:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div id=&amp;quot;navigation&amp;quot;&amp;gt;
   &amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;links.html&amp;quot; title=&amp;quot;Links&amp;quot;&amp;gt;Links&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
   &amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;contact.html&amp;quot; title=&amp;quot;Contact Me&amp;quot;&amp;gt;Contact Me&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;Let's say you want to ensure that all the paragraphs in your footer (which you've ID'd as "footer") have their lines spaced at 150% of the normal line spacing. By creating the following in your stylesheet:&lt;/p&gt;
						&lt;pre&gt;#footer p {
   line-height: 150%;
}&lt;/pre&gt;
						&lt;p&gt;you ensure that everything in your footer is so spaced:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;div id=&amp;quot;footer&amp;quot;&amp;gt;
   &amp;lt;p&amp;gt;Footer text.&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
						&lt;p&gt;while your other paragraphs enjoy the original spacing.&lt;/p&gt;
						&lt;p&gt;I cribbed those two examples directly from Lloyd's book; he provides several more that serve to thoroughly illustrate the concept.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Cascading Order&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;We've discussed the "style" aspect of CSS, but we have not mentioned the "cascading" aspect. Basically, this comes into play when one element is superseded by another in the stylesheet, or when two elements contradict one another. There must be some way for one element to "win out". The simplest (and therefore the least accurate) way to view this is "last one in wins." In other words, the last selector to be cited overrides earlier mentions.&lt;/p&gt;
						&lt;p&gt;Web designer Craig Grannell &lt;a href="http://www.amazon.com/Essential-Guide-HTML-Design-Essentials/dp/1590599071/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1274231475&amp;amp;sr=1-1" title="The Essential Guide to CSS&#xD;
and HTML Web Design"&gt;explains it a bit differently&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;The value closest to the element in question is the one that is applied.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Well, &lt;em&gt;that's&lt;/em&gt; confusing. Let's see an example. Let's say you make your &lt;code&gt;h2&lt;/code&gt; green:&lt;/p&gt;
						&lt;pre&gt;h2 {
   color: #008000;
}&lt;/pre&gt;
						&lt;p&gt;but farther down in your stylesheet, you forget what you did earlier, and again style your &lt;code&gt;h2&lt;/code&gt;, this time in stunning purple:&lt;/p&gt;
						&lt;pre&gt;h2 {
   color: #800080;
}&lt;/pre&gt;
						&lt;p&gt;All of your &lt;code&gt;h2&lt;/code&gt; text will appear in purple. The purple, appearing later in the stylesheet, overrides the green.&lt;/p&gt;
						&lt;p&gt;A more complete list of "CSS overrides," or "cascades," can be found in the &lt;a href="http://htmlhelp.com/reference/css/structure.html#cascade" title="Cascading Order"&gt;WDG HTML Help pages&lt;/a&gt;. I've simplified their list for you:&lt;/p&gt;
						&lt;ul&gt;
							&lt;li&gt;&lt;em&gt;!important.&lt;/em&gt; The &lt;code&gt;!important&lt;/code&gt; property wins out over everything, and as a result is often misused. Use this powerful property wisely and with restraint. More about the &lt;code&gt;!important&lt;/code&gt; property &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princsssel.html#nogo" title="coming soon"&gt;can be found here&lt;/a&gt;.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Specificity.&lt;/em&gt; The "specificity" rule is quite confusing, and is &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princsssel.html#nogo" title="coming soon"&gt;explained more thoroughly here&lt;/a&gt;. Basically, the higher a rule's specificity, the more "weight" it carries in the stylesheet, and will "win out" over a less "weighty" rule.&lt;/li&gt;
							&lt;li&gt;&lt;em&gt;Last rule specified wins.&lt;/em&gt; As described above. Both the &lt;code&gt;!important&lt;/code&gt; property and "specificity" win out over "last one in wins."&lt;/li&gt;
						&lt;/ul&gt;
						&lt;p&gt;It's also worth noting that when you import (or link) multiple stylesheets, say a print stylesheet, the cascade principle applies here, also. Anything in the second (or third, or fourth) stylesheet override the properties in the first.&lt;/p&gt;
						&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prindiffstyle.html#print" title="Web Design Principles Print Stylesheets"&gt;More about &lt;em&gt;print stylesheets&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Using Lower Case in CSS&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;It's not a hard-and-fast rule that you should use all lower case letters in typing your CSS, but, well, you should. It's &lt;span&gt;best practices&lt;/span&gt; for a number of reasons, mostly consistency, and because if you ever find yourself writing XHTML, you'll &lt;em&gt;have&lt;/em&gt; to use lower case letters. So why not use it from the outset? Also, &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princlass.html" title="Web Design Principles Classes and IDs"&gt;CSS classes and IDs&lt;/a&gt; are case-sensitive: in other words, this class:&lt;/p&gt;
						&lt;pre&gt;.typeset&lt;/pre&gt;
						&lt;p&gt;is different from this one:&lt;/p&gt;
						&lt;pre&gt;.typeSet&lt;/pre&gt;
						&lt;p&gt;You can imagine the confusion that could ensue once you start going down that road. Unless you can keep all of those upper- and lower-case class and IDs straight, just use lower case letters in all of your CSS. You'll be glad you did.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275192642754"><id gr:original-id="">tag:google.com,2005:reader/item/5ddba3f00cad5fd6</id><title type="html">CSS Definition and Characteristics » Best Practices HTML and CSS</title><published>2010-05-30T04:10:42Z</published><updated>2010-05-30T04:10:42Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princss.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princss.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princss.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;CSS: Definition and Characteristics&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/technowall.jpg" alt="wall of color" title="wall of color"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;The definition and characteristics of CSS.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;						
						&lt;blockquote&gt;&lt;p&gt;You affect the world by what you browse. — &lt;a href="http://www.brainyquote.com/quotes/quotes/t/timberners100459.html" title="Quote from BrainyQuote"&gt;Tim Berners-Lee&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt; 
							&lt;p&gt;&lt;strong&gt;Contents of This Page&lt;/strong&gt;&lt;/p&gt;
								&lt;ul&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princss.html#forward" title="Looking Backward to Move Forward"&gt;Moving Forward&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princss.html#structure" title="Separating Content and Structure from Presentation"&gt;Structure vs. Presentation&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princss.html#tables" title="CSS Instead of Tables"&gt;CSS Instead of Tables&lt;/a&gt;&lt;/li&gt;
									&lt;li&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/princss.html#browser" title="Cascading Order"&gt;Browser Support for CSS&lt;/a&gt;&lt;/li&gt;
								&lt;/ul&gt;
						&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;						&lt;p&gt;CSS stands for "Cascading Style Sheet." Like many, I write the word as "stylesheet" (one word, not two). I won't get into the semantics of "stylesheet" vs. "style sheet." You will see both in your travels around the Web.&lt;/p&gt;
						&lt;p&gt;According to a definition written by &lt;a href="http://www.westciv.com/style_master/hands_on_tutorial_sm/02.css_intro.html" title="A short introduction to style sheets"&gt;Maxine Sherrin and John Allsopp of Westciv&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;A stylesheet is a set of instructions each of which tells a browser how to draw a particular element on a page. It's very important to grasp this idea of HTML elements when you are working with CSS.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Web specialist &lt;a href="http://www.amazon.com/Essential-Guide-HTML-Design-Essentials/dp/1590599071/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1274231475&amp;amp;sr=1-1" title="The Essential Guide to CSS&#xD;
and HTML Web Design"&gt;Craig Grannell&lt;/a&gt; gives a longer take:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;CSS is the W3C standard for defining the visual presentation for web pages. HTML was
designed as a structural markup language, but the demands of users and designers encouraged browser manufacturers to support and develop presentation-oriented tags. These tags "polluted" HTML, pushing the language toward one of decorative style rather than logical structure. Its increasing complexity made life hard for web designers, and source code began to balloon for even basic presentation-oriented tasks. Along with creating needlessly large HTML files, things like font tags created web pages that weren't consistent across browsers and platforms, and styles had to be applied to individual elements — a time-consuming process.&lt;/p&gt;
						&lt;p&gt;The concept behind CSS was simple, yet revolutionary: remove the presentation and separate design from content. Let HTML (and later XHTML) deal with structure, and use a separate CSS document for the application of visual presentation.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;And author and Web designer &lt;a href="http://www.sitepoint.com/books/cssant3/" title="The CSS Anthology"&gt;Rachel Andrew&lt;/a&gt; writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;The basic purpose of CSS is to allow the designer to define &lt;strong&gt;style declarations&lt;/strong&gt; (formatting details such as fonts, element sizes, and colors), and to apply those styles to selected portions of HTML pages using &lt;strong&gt;selectors&lt;/strong&gt; — references to an element or group of elements to which the style is applied.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Think about driving through a particular neighborhood. If all the homes were built by the same developer, you might see the same three or four house styles repeated over and over again. But each one has differences — different color schemes, different landscaping, shutters on the windows or a lack thereof, different kinds of roof shingling, bay windows or casement windows, myriad other differences. Think of the fundamental house structures as the HTML of a site, and the different stylings and "decorations" as the CSS. (Actually, this isn't a great analogy — CSS can control much of a site's structure, and it adds a lot more to a site's final appearance and function than a paint job or a set of oak shutters does to a house. But it's a bad starting point.)&lt;/p&gt;
						&lt;p&gt;Someone very knowledgeable wrote about CSS for &lt;a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets" title="Cascading Style Sheets"&gt;Wikipedia&lt;/a&gt;. Roger Johannson of 456 Berea Street wrote &lt;a href="http://www.456bereastreet.com/lab/developing_with_web_standards/structure/" title="Structure and presentation"&gt;a more in-depth article on the subject&lt;/a&gt;. Using their articles, and Andrew's book &lt;em&gt;The CSS Anthology&lt;/em&gt;, as guides for the content on this page, I can start by telling you that CSS describes the &lt;em&gt;presentation semantics&lt;/em&gt;, or the look and formatting, of a Web page.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Looking Backward to Move Forward&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Sometimes it's helpful to look backwards before we move forward. Here's an example of Then vs. Now, cribbed from &lt;a href="http://wendypeck.com/css101.html" title="Bare Bones, No Crap, CSS Text Control Primer"&gt;Wendy Peck's Bare Bones, No Crap, CSS Text Control Primer&lt;/a&gt;. (I love it for the title alone.)&lt;/p&gt;
						&lt;p style="font-variant:small-caps"&gt;The Old Broke-Down Fogey Way of Controlling Presentation:&lt;/p&gt;
						&lt;pre&gt;&amp;lt;p&amp;gt;&amp;lt;font color=&amp;quot;#ff0000&amp;quot; size=&amp;quot;2&amp;quot; face=&amp;quot;Verdana, Arial, Helvetica, sans-serif&amp;quot;&amp;gt;Text ready for control.&amp;lt;/font&amp;gt;&lt;/pre&gt;
						&lt;p&gt;Yes, your browser will read this and style the paragraph appropriately. So what's the problem?&lt;/p&gt;
						&lt;p&gt;Imagine having a dozen, or a hundred, such paragraphs on your page. Every one needs styling — some differently than others. When you make a change to one, you need to comb through the page, making the same change a dozen or a hundred times — and when you're finished, you get to go through the process again on the next page in the site. And the next.&lt;/p&gt;
						&lt;p&gt;&lt;span style="font-variant:small-caps"&gt;The New Hotness Way of Controlling Presentation&lt;/span&gt; (if by "new" you mean "since around 1998")&lt;/p&gt;
						&lt;pre&gt;&lt;span&gt;The CSS&lt;/span&gt;
p {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   font-size: 12px;
   color: #ff0000;
}

&lt;span&gt;The HTML&lt;/span&gt;
&amp;lt;p&amp;gt;Simple content text ready for control.&amp;lt;/p&amp;gt;&lt;/pre&gt;
						&lt;p&gt;Want to change the color of your dozens of paragraphs from &lt;code&gt;#ff0000&lt;/code&gt; to something else, say a nice light blue: &lt;code&gt;#f0f8ff&lt;/code&gt;? Easy, just change one line of CSS:
						&lt;/p&gt;&lt;pre&gt;color: #f0f8ff;&lt;/pre&gt;
						&lt;p&gt;Changes done, go have a cup of coffee. Peck observes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;No matter how fancy CSS may get, this is the basic principle. The real power, other than reducing the amount of code in each page dramatically, is the ability to change your mind because the control for the text and the text are in totally different places.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Separating Content and Structure from Presentation&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;The biggest reason why we have two separate entities — HTML and CSS — is to separate document structure and content from its presentation.&lt;/p&gt;
						&lt;p&gt;Johannson writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Structure&lt;/strong&gt; consists of the mandatory parts of an HTML document plus the semantic and structured markup of its contents. &lt;strong&gt;Presentation&lt;/strong&gt; is the style you give the content. In most cases presentation is about the way a document looks, but it can also affect how a document sounds — not everybody uses a graphical web browser. Separate structure from presentation as much as possible. Ideally you should end up with an HTML document which contains the structure and content, and a separate CSS file which contains everything that controls presentation. ... When an HTML element exists that has a structural meaning suitable for the part of the content that is being marked up, there is no reason to use anything else. In other words, &lt;strong&gt;do not&lt;/strong&gt; use CSS to make an HTML element look like another HTML element, for instance by using a span element instead of an h1 element to mark up a heading. By using semantic HTML, you will make the different parts of a document meaningful to any web browser, be it the very latest graphical web browsers on a modern PC, an old web browser that doesn’t handle CSS, a text-based browser in a Unix shell, or assistive technology used by people with disabilities.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Wikipedia notes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;This separation can improve content accessibility, provide more flexibility and control in the specification of presentation characteristics, enable multiple pages to share formatting, and reduce complexity and repetition in the structural content ... &lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Later in his document, Johannson notes quite accurately that for CSS to properly control the stylings and presentation of an HTML document, the HTML must be semantically accurate and well-formed. One cannot hide or override the flaws of the other.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;CSS Instead of Tables&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;One of the primary functions of CSS is to control the &lt;em&gt;layout&lt;/em&gt; of a Web page. (My stylesheet for this site controls this page's three-column, header/footer layout, for example.) A lot of very good, and very capable, designers still use &lt;em&gt;tables&lt;/em&gt; for laying out their sites. There are dozens of reasons why this is no longer viable in a modern, best practices-driven Web design world (one design firm, Chromatic, lays out &lt;a href="http://www.chromaticsites.com/blog/13-reasons-why-css-is-superior-to-tables-in-website-design/" title="13 Reasons Why CSS Is Superior to Tables in Website Design"&gt;13 very good reasons&lt;/a&gt;, in some detail), but trust me, table-driven layouts are over and done with. When someone who seems knowledgeable about Web design advocates tables over CSS to you, ask them why they're not running &lt;span title="Microsoft released it in 1992"&gt;Windows 3.1&lt;/span&gt; instead of their WinXP or Win7 on their computers — or why they're not using an &lt;span title="Apple released it in 1983"&gt;Apple Lisa&lt;/span&gt; instead of a Mac OSX.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;strong&gt;Browser Support for CSS&lt;/strong&gt;&lt;/p&gt;
						&lt;p&gt;Not all browsers support CSS's most modern accepted form, CSS 2.1, completely. (CSS 3 is in development, and us design folks are all giddy about it, but it will be years before a majority of browsers implement its elements properly, so for now, let's stick with CSS 2.1. That's quite enough to deal with!)&lt;/p&gt;
						&lt;p&gt;As noted above, different browsers manage CSS (and HTML) with varying degrees of accuracy. &lt;em&gt;None&lt;/em&gt; of them get it right 100% of the time, but some come very close. Browsers actually come in families, and the families each have their own strengths and weaknesses.&lt;/p&gt;
						&lt;dl&gt;
							&lt;dt&gt;&lt;strong&gt;The Gecko Family&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;Includes Firefox, Camino, Flock, SeaMonkey, etc. Very, very good at handling CSS.&lt;/dd&gt;
							&lt;dt&gt;&lt;strong&gt;Presto&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;Opera is the only browser in this family. Also very strong at handling CSS.&lt;/dd&gt;
							&lt;dt&gt;&lt;strong&gt;The Webkit Family&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;Mac's Safari and Google's Chrome, along with OmniWeb, Shiira, iCab, and others are Webkit browsers, and all handle CSS quite well.&lt;/dd&gt;
							&lt;dt&gt;&lt;strong&gt;The Trident Family&lt;/strong&gt;&lt;/dt&gt;
								&lt;dd&gt;Internet Explorer (the big dog in the yard), Maxthon, Sleipnir, NeoPlanet, and a few other browsers comprise this family of browsers. There's always one dysfunctional crowd in the neighborhood, and this one is it. Microsoft claims that IE8 fully supports CSS 2.1. It doesn't, though it's much better than IE7, and light-years ahead of its predecessor, the almost hatefully deficient IE6. As for IE9, we'll see in 2011.&lt;/dd&gt;
						&lt;/dl&gt;
						&lt;p&gt;Because a majority of the world's computer users surf the Web with some version of Internet Explorer, you have to design with IE's flaws and bugs in mind. There is an entire cottage industry of designers who have documented and attempted to find fixes or "hacks" for a plethora of IE bugs. Sooner or later, you will find yourself making use of their work.&lt;/p&gt;
						&lt;p&gt;Some designers get snippy about supporting IE6 and other superseded, "obsolete" browsers. "Those people need to get with the new millennium," they snap. "I would no more design for IE6 than I would build a car that burns leaded gasoline." That's their prerogative, but to my mind it's exclusionary and wrong. Hundreds of thousands of Web users (at the least) rely on IE6 for their Internet needs, whether by choice (informed or not) or by necessity. To lock them out of your Web site because you think their browser is not serving the needs of your users.&lt;/p&gt;
						&lt;p&gt;Roger Johannson agrees, while acknowledging the limitations of designing for IE and other less functional browsers. He observes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;It's important to stress that people using old (obsolete) browsers and browsers that by design do not support CSS must not be locked out. In the nineties, browser sniffing was a popular way of redirecting people using the 'wrong' browser (normally anything but Internet Explorer for Windows) to a page that told them to upgrade their browser to gain access to the site. These days you can handle unsupported browsers in a better way. One big advantage of using logical, semantic HTML is that it makes documents accessible and usable even without CSS. The presentation — the way the document looks — won't be the same as in a supported browser, but the content will be there. In most cases, for most visitors to a site, the content is actually more important than the way it is presented. That's why it is better to send an unstyled page to unsupported browsers than to lock them out of the site.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Sending your less up-to-date users to an unstyled version of your site is a drastic solution, but sometimes necessary. More often, we can have the design "degrade," presenting a less sophisticated version of our styling and presentation for the less capable browsers without losing functionality, elegance, or appeal.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1275192608359"><id gr:original-id="">tag:google.com,2005:reader/item/f1ba9debef6b87a4</id><title type="html">Validating Your Code » Best Practices HTML and CSS</title><published>2010-05-30T04:10:08Z</published><updated>2010-05-30T04:10:08Z</updated><link rel="alternate" href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinvalid.html" type="text/html" /><link rel="related" href="http://www.iraqtimeline.com/" title="www.iraqtimeline.com" /><content xml:base="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinvalid.html" type="html">&lt;blockquote&gt;Shared by  Max Black 
&lt;br&gt;
designsite&lt;/blockquote&gt;
&lt;div&gt;&lt;h2&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/prinvalid.html#"&gt;Web Design Principles&lt;/a&gt;&lt;br&gt;Validating Your Code&lt;/h2&gt;
					&lt;/div&gt;
					
					&lt;div&gt;
						&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/centerimages/redcheck.jpg" alt="red check" title="red check"&gt;
						&lt;h4&gt;Looking for the lessons? &lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/maintut.html" title="Web Design Lessons Main Page"&gt;Get started!&lt;/a&gt;&lt;/h4&gt;
						
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;&lt;strong&gt;How to validate your code, and why you should.&lt;/strong&gt;&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;p&gt;The entire Web Design Principles section can be accessed through the menu below.&lt;/p&gt;
						&lt;div&gt;
							&lt;p&gt;&lt;a href="http://www.iraqtimeline.com/maxdesign/basicdesign/principles/pmenu.html"&gt;Principles Links&lt;/a&gt;&lt;/p&gt;
						&lt;/div&gt;
						
						
						
						&lt;div&gt;&lt;/div&gt;
						&lt;div&gt;&lt;/div&gt;
						&lt;blockquote&gt;&lt;p&gt;These technologies, which we call "web standards," are carefully designed to deliver the greatest benefits to the greatest number of web users while ensuring the long-term viability of any document published on the Web. — &lt;a href="http://webstandardsgroup.org/standards/" title="Web Standards Group"&gt;Web Standards Group&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
						
						&lt;div&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/html_valid.png" alt="html icon" title="html icon"&gt; &lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/icons/css_valid.png" alt="css icon" title="css icon"&gt;&lt;/div&gt;
						&lt;p&gt;Even the most proficient Web designers sometimes fail to validate their documents — &lt;a href="http://validator.w3.org/about.html" title="About The W3C Markup Validation Service"&gt;checking a Web document against the existing, DOCTYPE-specific technical specifications&lt;/a&gt;. This is always a mistake. HTML and CSS validation does not guarantee perfect Web documents, and some truly heinous Web sites can be designed that are completely valid. However, there are compelling reasons why you should make every effort to learn HTML- and CSS-valid standards, and comply with them. It's &lt;span&gt;best practice&lt;/span&gt;.&lt;/p&gt;
						&lt;p&gt;Validating your Web page won't guarantee that it will appear just the way you want it. It only ensures that your code is free of syntax errors. As &lt;a href="http://www.456bereastreet.com/lab/developing_with_web_standards/webstandards/" title="Web standards"&gt;Roger Johannson writes&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Note that "works in any web browser" does not mean "looks the same in every web browser." Making a document look identical across browsers and platforms is next to impossible. Not even using only images will make a website look exactly the same everywhere. Documents that are published on the web will be accessed by a wide variety of browsing devices on several operating systems, with monitors of differing size and quality (or no monitor at all), by users who may have changed their browser's default text size and other preferences. Realising this and accepting that you simply cannot fully control the visual appearance of a website in your visitors' browsers will make your life a lot less frustrating. Anyone who creates websites needs to understand that there are technical prerequisites to consider, the same way as those who publish on paper or make movies or television have other prerequisites to consider.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Having said that, let's look at some reasons why you should validate your designs. (Much of the following information is sourced from an article by Nick Kew and provided to the &lt;a href="http://validator.w3.org/docs/why.html" title="Why Validate"&gt;World Wide Web Consortium&lt;/a&gt;, , a classic &lt;a href="http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you" title="Why we won&amp;#39;t help you"&gt;2003 article from Mark Pilgrim&lt;/a&gt;, the Roger Johannson article cited above, and from &lt;a href="http://dev.opera.com/articles/view/1-introduction-to-the-web-standards-cur/" title="Introduction to The Web Standards Curriculum"&gt;Opera's Web Standards Curriculum&lt;/a&gt; set of hands-on tutorials.)&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Validation Helps You Find Errors&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;This may sound like a "duh" statement, but often designers like you (and me) sit and stare at dysfunctional Web pages for minutes, hours, or even days trying and failing to find an error that is breaking your site. Validation can often find those small, hard-to-spot errors almost instantly. Pilgrim writes: "[T]he validator is an automated tool that can highlight small but important errors that are difficult to track down by hand, and may actually solve the problem that's driven you crazy. If you create valid markup most of the time, you can take advantage of this automation to catch your occasional mistakes. But if your markup is nowhere near valid, you'll be flying blind when something goes wrong. The validator will spit out dozens or even hundreds of errors on your page, and finding the one that is actually causing your problem will be like finding a needle in a haystack." As you learn to write valid code, you will make fewer errors, and the validator will actually be &lt;em&gt;more&lt;/em&gt; useful in finding the few mistakes that have crept into your code.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Ensuring Pages Display as Identically as Possible across Different Browsers&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;While most modern browsers manage to sort out a lot of error-riddled HTML pages, the errors are not always caught and handled gracefully. Worse, different browsers don't handle errors the same way, resulting in differences in style, appearance, layout, and/or even function. Kew writes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;"Using standard, interoperable markup and stylesheets, on the other hand, offers a much greater chance of having one's page handled consistently across platforms and user-agents. Indeed, most developers creating rich Web applications know that reliable scripting needs the document to be parsed by [browsers] without any unexpected error, and will make sure that their markup and CSS is validated before creating a rich interactive layer. When surveyed, a large majority of Web professionals will state that validation errors is the first thing they will check whenever they run into a Web styling or scripting bug."&lt;/p&gt;&lt;/blockquote&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Faster Downloading and Rendering of Your Pages&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Not only does CSS make HTML pages smaller, leaner, and more efficient, thereby speeding their download time, clean and valid code ensures that the browsers are not slowed by quirky, erratic, or broken code.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Better Accessibility&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Disabled users employing screen readers and other "assistive technologies" will be far better served by clean, standards-compliant HTML and CSS.&lt;/p&gt;
						&lt;p&gt;Opera's Chris Mills &lt;a href="http://dev.opera.com/articles/view/1-introduction-to-the-web-standards-cur/" title="Introduction to The Web Standards Curriculum"&gt;writes&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;[O]ne of the big issues on the Web is &lt;strong&gt;making web sites accessible to everyone, no matter who they are, regardless of circumstance&lt;/strong&gt;. This includes making web sites usable by people with disabilities such as blindness/visual impairment and motor impairment (ie, people who have restricted movement, and might not be able to use their hands properly, or at all). By using web standards and best practices, you’ll be able to make your web sites usable by this significant group of the web audience with no extra effort.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Coding for the Future&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Creating error-free, standards-valid HTML and CSS is the best guarantee that your Web pages remain consistent, accurate, and functional as possible as time wears on, browsers update, and standards change. W3C tells us, "Validation is one of the simplest ways to check whether a page is built in accordance with Web standards, and provides one of the most reliable guarantee that future Web platforms will handle it as designed."&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Teaching Best Practices&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;As noted above, writing valid, standards-compliant code is &lt;span&gt;best practice&lt;/span&gt; for Web design. It also teaches and encourages best practices for Web design. While many veterans have learned to create error-free code and make relatively few validation errors, most beginners make more errors. Computer validation checks can help beginners learn from their mistakes.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Increasing Your Search Engine Ranking&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Web designer and marketer &lt;a href="http://www.searchenginepromotionhelp.com/m/articles/search-engine-problems/why-validate-html.php" title="Why You Should Validate Your HTML"&gt;Christine Churchill notes&lt;/a&gt;, "Bad HTML can hurt your site in the search engines without you ever realizing it. ...  While [modern ] browsers are very forgiving of your HTML errors, search engine spiders aren't nearly as kind. It helps to think of a search engine spider as a web browser — just like a browser, the spider needs to interpret your page and figure out what you're saying. Only then can it properly index your page. Search engine spiders also care about the structure of your Web page because they give extra weight to keywords placed inside certain HTML tags." She notes that most beginners will almost certainly find validating their sites frustrating, tedious, and even pointless. But as the beginner improves his/her skills, the number of errors will decrease, the site design will improve, and the frustration will decrease. Johannson agrees: "The separation of content and presentation makes the content represent a larger part of the total file size. Combined with semantic markup this generally improves search engine rankings."&lt;/p&gt;
						&lt;p&gt;Search strategist and online marketing expert Joost de Valk &lt;a href="http://dev.opera.com/articles/view/intelligent-site-structure-for-better-se/" title="Intelligent site structure for better SEO"&gt;agrees that designing to Web standards helps optimize sites for search engines&lt;/a&gt;. You might take a close look at de Valk's article to see how he reorganized his site structure to make it more user- and SEO-friendly. He concludes:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;A good site structure is a requirement for Search Engine Optimization. It allows both your users and search engines to find content within your site more easily. A good structure is well categorized, and pages within it only link to other pages on the same topic.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;De Valk also writes a useful article on &lt;a href="http://dev.opera.com/articles/view/semantic-html-and-search-engine-optimiza/" title="Semantic HTML and Search Engine Optimization"&gt;POSH, or "Plain Old Semantic HTML"&lt;/a&gt;, a popular paradigm of standards-based practices. If you follow Web standards and &lt;span&gt;best practices&lt;/span&gt; as delineated in this site, you're pretty much following POSH standards as well.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Simpler Adaptation&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Coding to Web standards helps ensure that your sites work not only with different operating systems (Windows, Mac, Linux), but with alternative browsing systems, including mobile phones, televisions, PDAs, gaming consoles, and iPads. While these devices often have limitations such as screen size, processing power, and others, if you adhere to current standards, you can be all but certain that your site will work on all of these devices. Mills reminds designers: "There are more mobile phones in the world than PCs, a lot of which are Internet-capable, so can you or your clients afford to miss out on this market?"&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Ensuring Others are Willing to Help You Fix Your Problem&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;I learned to code by trial and error, and by frequently shouting for assistance on the &lt;a href="http://www.sitepoint.com/forums/" title="SitePoint Forums"&gt;SitePoint forums&lt;/a&gt;. One reason why I've stayed with SitePoint for years is their acceptance of me as (then) a newbie Web designer (and now a journeyman designer who still asks "duh" questions), and their willingness to walk me through my mistakes. But more than once they advised me to validate my code and come back. They were far nicer about it than most people are willing to be. Pilgrim points this out in his essay: typically, the new designers creates a "Help!" post on some design forum, and is told, "Validate your code and then come back if you need help." Sometimes the questioners come back, often they do not. If you validate your code, fix the errors you know how to fix, and then shout for help on an expert forum, you're far more likely to get the assistance you need.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;A Sign of Professionalism&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Creating valid, error-free Web sites is a strong sign that the designer adheres to professional standards. Kew writes: "Seasoned, able professionals will take pride in creating Web content using semantic and well-formed markup, separation of style and content, etc. Validation can then be used as a quick check to determine whether the code is the clean work of a seasoned HTML author, or quickly hacked-together tag soup."&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Why Don't Big Corporate Sites Pass Validation?&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;In June 2008, Web entrepeneur Jonathan Lane &lt;a href="http://dev.opera.com/articles/view/5-web-standards-beautiful-dream-bu/" title="Web standards -- beautiful dream, but what&amp;#39;s the reality"&gt;noted that the Web sites of 35 (out of 40) Fortune 500 companies failed validation&lt;/a&gt;. One of the most spectacular failures was of Amazon's Web site; other validation failures were registered for Microsoft.com, Google.com, Apple.com, Yahoo.com, MySpace.com, and many other Web behemoths. Take a look at Jonathan's chart below, which shows the breakdown among valid and invalid corporate sites. (This graph is from mid-2008, so I'm sure things have changed somewhat since then. But I doubt that much...)&lt;/p&gt;
						&lt;p&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/validpie.jpg" title="pie graph showing number of invalid Fortune 500 sites" alt="pie graph showing number of invalid Fortune 500 sites"&gt;&lt;/p&gt;
						&lt;p&gt;(Image from Jonathan Lane's article cited above, used under the Creative Commons free distribution license.)&lt;/p&gt;
&lt;p&gt;There are any number of reasons why large, expansive (and undoubtedly expensive) Web sites for such firms. Lane speculates that Amazon's 1500 validation errors (including the lack of a DOCTYPE!) comes from a failure to upgrade their site management system. Other, less flagrantly invalid corporate sites may be from inattention, a failure of their content management systems to produce valid code, lack of willingness to create standards-compliant code, ignorance, or laziness. Or all of the above.&lt;/p&gt;
						&lt;div&gt;&lt;/div&gt;
						
						&lt;p&gt;&lt;em&gt;Summing Up&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;My friend Tommy Olsson &lt;a href="http://articles.sitepoint.com/article/html-37-steps-perfect-markup" title="Bulletproof HTML"&gt;sums it up nicely&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Why should we spell-check our text before publishing it on the web? Because mistakes and errors can confuse readers and detract from the important information. The same can be said for markup. Invalid markup can confuse browsers, search engines and other user agents. The result can be improper rendering, dysfunctional pages, pages that remain unindexed by the search engines, program crashes or the end of the universe as we know it! If our page doesn't display the way we intended, we should always validate our markup before we start looking for other problems ... With invalid markup, there are no guarantees.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;On the other hand, Jukka Korpela &lt;a href="http://www.cs.tut.fi/~jkorpela/html/validation.html" title="HTML validation is a good tool, but just a tool"&gt;gives us a useful caveat&lt;/a&gt;:&lt;/p&gt;
						&lt;blockquote&gt;&lt;p&gt;Validation is about catching some syntax errors, nothing more. It is useful only if you know the syntax rules so that you can see what's wrong. Validation does not do anything that you would not be able to do on your own. Validation is useful because you, being presumably human, are not particularly good at following formal rules or checking that they are obeyed. Thus, a validator does not teach you how to write HTML. It just points out mistakes. You are supposed to learn HTML from other sources.&lt;/p&gt;&lt;/blockquote&gt;
						&lt;p&gt;Korpela provides an interesting and useful essay on the limitations of validating your HTML and CSS, and the misunderstandings many people bring to the concept of validation.&lt;/p&gt;
						&lt;p&gt;In that same vein, a poster on the Pilgrim article writes: "There is a problem though, at a certain level of knowledge, that you need a little help to understand what validation is and how to use a validator. I had a real steep learning curve when I started doing web standards stuff, and frankly I got a bit peeved at RTFM type comments. Sometimes you don't have quite enough knowledge to know WHY that part of the manual is of use to you." He is absolutely right. Validators can be confusing and frustrating for beginners to use.&lt;/p&gt;
						&lt;p&gt;The Wikipedia article on the popular W3C validation service (see below), based in part on the seminal book &lt;em&gt;HTML, XHTML &amp;amp; CSS&lt;/em&gt; by Elisabeth Castro, notes: "All mark-up validators suffer from an inability to see the 'big picture' on a web page. However they excel at picking up missed closing tags and other technicalities. This does not mean that the page will display as the author intended in all browsers. Even if validated, all web pages should be tested in as many different browsers as possible to ensure that the limitations of the validator are compensated for and that the page works correctly."&lt;/p&gt;
						
						&lt;p&gt;&lt;em&gt;Using the W3C Validator&lt;/em&gt;&lt;/p&gt;
						&lt;p&gt;Probably the best overall way to validate your markup is to use the free &lt;a href="http://validator.w3.org/" title="W3 Validator"&gt;W3 Validator&lt;/a&gt;, as noted above.&lt;/p&gt;
						&lt;p&gt;&lt;img src="http://www.iraqtimeline.com/maxdesign/basicdesign/images/w3cvalid.jpg" title="image of validation message" alt="image of validation message"&gt;&lt;/p&gt;
						&lt;p&gt;(There are other good validators out there, but the W3 Validator is the "gold standard" for HTML and CSS validation.) It can be a bit confusing to the beginner, but practice will give you a good grasp of how to fix the errors the validator finds. Olsson reminds us, "Don't forget to include a DOCTYPE declaration, so the validator knows against which standards it should check your document." Olsson and many others recommend &lt;a href="http://tidy.sourceforge.net/" title="HTML Tidy"&gt;HTML Tidy&lt;/a&gt; as a good (and free) program to help you tidy up sloppy or invalid code. Firefox users can download and install the &lt;a href="http://users.skynet.be/mgueury/mozilla/" title="HTML Validator"&gt;HTML Validator&lt;/a&gt;, an add-on based on HTML Tidy, to facilitate validation from within the browser. Opera users can just right-click a page and validate it (via a link to the W3 Validator) from a menu option.&lt;/p&gt;&lt;/div&gt;
</content><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:annotation><content type="html">designsite</content><author gr:user-id="18328930614534143407" gr:profile-id="103893662053699531483"><name>Max Black</name></author></gr:annotation><source gr:stream-id="user/18328930614534143407/source/com.google/link"><id>tag:google.com,2005:reader/user/18328930614534143407/source/com.google/link</id><title type="html">www.iraqtimeline.com</title><link rel="alternate" href="http://www.iraqtimeline.com/" type="text/html" /></source></entry></feed>

