<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <link href="https://friendlybit.com/feed/" rel="self" type="application/atom+xml" />
    <link href="https://friendlybit.com/" rel="alternate" type="text/html" />
    <updated>2010-01-11T01:04:33+01:00</updated>
    <id>https://friendlybit.com</id>
    <title type="html">Friendly Bit - Web development blog</title>
    <subtitle>Friendly Bit is a blog by Emil Stenström, a Swedish web developer that occasionally gets ideas of how to improve the internet.</subtitle>
    
        <entry>
            <title type="html">Rendering a web page – step by step</title>
            <link href="http://friendlybit.com/css/rendering-a-web-page-step-by-step/" rel="alternate" type="text/html" title="Rendering a web page – step by step" />
            <published>2010-01-11T01:04:33+01:00</published>
            <updated>2010-01-11T01:04:33+01:00</updated>
            <id>http://friendlybit.com/css/rendering-a-web-page-step-by-step/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Have you ever thought about what happens when you surf the web? It&#39;s not as simple as it seems: You type an URL into address bar in your preferred browser....</summary>
            <content type="html" xml:base="http://friendlybit.com/css/rendering-a-web-page-step-by-step/">
                &lt;p&gt;Have you ever thought about what happens when you surf the web? It&#39;s not as simple as it seems:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You &lt;strong&gt;type an URL&lt;/strong&gt; into address bar in your preferred browser.&lt;/li&gt;
&lt;li&gt;The browser &lt;strong&gt;parses the URL&lt;/strong&gt; to find the protocol, host, port, and path.&lt;/li&gt;
&lt;li&gt;It &lt;strong&gt;forms a HTTP request&lt;/strong&gt; (that was most likely the protocol)&lt;/li&gt;
&lt;li&gt;To reach the host, it first needs to &lt;strong&gt;translate&lt;/strong&gt; the human readable host &lt;strong&gt;into an IP number&lt;/strong&gt;, and it does this by doing a DNS lookup on the host&lt;/li&gt;
&lt;li&gt;Then a &lt;strong&gt;socket needs to be opened&lt;/strong&gt; from the user&#39;s computer to that IP number, on the port specified (most often port 80)&lt;/li&gt;
&lt;li&gt;When a connection is open, the &lt;strong&gt;HTTP request is sent&lt;/strong&gt; to the host&lt;/li&gt;
&lt;li&gt;The host &lt;strong&gt;forwards the request&lt;/strong&gt; to the server software (most often Apache) configured to listen on the specified port&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;server inspects the request&lt;/strong&gt; (most often only the path), and &lt;strong&gt;launches the server plugin needed&lt;/strong&gt; to handle the request (corresponding to the server language you use, PHP, Java, .NET, Python?)&lt;/li&gt;
&lt;li&gt;The plugin gets access to the full request, and starts to prepare a HTTP response.&lt;/li&gt;
&lt;li&gt;To construct the response a &lt;strong&gt;database&lt;/strong&gt; is (most likely) &lt;strong&gt;accessed&lt;/strong&gt;. A database search is made, based on parameters in the path (or data) of the request&lt;/li&gt;
&lt;li&gt;Data from the database, together with other information the plugin decides to add, is &lt;strong&gt;combined into a long string&lt;/strong&gt; of text (probably HTML).&lt;/li&gt;
&lt;li&gt;The plugin &lt;strong&gt;combines&lt;/strong&gt; that data with some meta data (in the form of HTTP headers), and &lt;strong&gt;sends the HTTP response&lt;/strong&gt; back to the browser.&lt;/li&gt;
&lt;li&gt;The browser receives the response, and &lt;strong&gt;parses the HTML&lt;/strong&gt; (which with 95% probability is broken) in the response&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;DOM tree is built&lt;/strong&gt; out of the broken HTML&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;New requests are made&lt;/strong&gt; to the server for each new resource that is found in the HTML source (typically images, style sheets, and JavaScript files). Go back to step 3 and repeat for each resource.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stylesheets are parsed&lt;/strong&gt;, and the rendering information in each gets attached to the matching node in the DOM tree&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Javascript is parsed and executed&lt;/strong&gt;, and DOM nodes are moved and style information is updated accordingly&lt;/li&gt;
&lt;li&gt;The browser &lt;strong&gt;renders the page&lt;/strong&gt; on the screen according to the DOM tree and the style information for each node&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;You&lt;/strong&gt; &lt;strong&gt;see&lt;/strong&gt; the page on the screen&lt;/li&gt;
&lt;li&gt;You get annoyed the whole process was too slow.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I, too, get annoyed when the above steps take longer than one tenth of a second. But now at least I have some documentation to look at, while waiting the remaining fractions of a second before the page renders.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://www.flickr.com/photos/amboo213/115034446/sizes/s/&#34;&gt;&lt;img class=&#34;alignnone&#34; title=&#34;Spoiled dog - by amboo213 on Flickr&#34; src=&#34;http://farm1.static.flickr.com/45/115034446_8bf43c2273_m.jpg&#34; alt=&#34;Spoiled dog&#34; width=&#34;240&#34; height=&#34;180&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Spoiled we are, all of us.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;(Feel free to add more steps, through the comments…)&lt;/em&gt;&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Position: fixed CSS templates</title>
            <link href="http://friendlybit.com/css/position-fixed-css-templates/" rel="alternate" type="text/html" title="Position: fixed CSS templates" />
            <published>2009-12-31T15:14:26+01:00</published>
            <updated>2009-12-31T15:14:26+01:00</updated>
            <id>http://friendlybit.com/css/position-fixed-css-templates/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">In 2006 I wrote an article about simulating Frames and Iframes and from time to time, I get questions of how to make modifications to the templates...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/position-fixed-css-templates/">
                &lt;p&gt;In 2006 I wrote an article about &lt;a href=&#34;/css/frames-or-iframes-with-css/&#34;&gt;simulating Frames and Iframes&lt;/a&gt; and from time to time, I get questions of how to make modifications to the templates presented. But one big thing has changed since 2006: &lt;strong&gt;Perfect support for IE6 is no longer mandatory&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;So yesterday, when Brandon Cobb of &lt;a href=&#34;http://superfighter.com/&#34;&gt;Super Fighter Team&lt;/a&gt; asked about a design with a fixed header, fixed left column, and scrolling right column, I thought I&#39;d renew my take on &lt;a href=&#34;/css/frames-or-iframes-with-css/&#34;&gt;simulating frames&lt;/a&gt; with CSS (The original article is still good for background information, so I still recommend reading it).&lt;/p&gt;
&lt;h2 id=&#34;position-fixed-css-templates&#34;&gt;Position: fixed CSS templates&lt;a href=&#34;#position-fixed-css-templates&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The idea is this: Instead of specifying what parts of the page should scroll, we can &lt;strong&gt;specify what parts should stay fixed when scrolling&lt;/strong&gt;. This makes it easier to deal with several fixed parts of the same layout, but also allows us do to things frames cannot do.&lt;/p&gt;
&lt;p&gt;So what&#39;s the trick? Well, &lt;code&gt;position: fixed&lt;/code&gt; does exactly what we want. It works just like &lt;code&gt;position: absolute&lt;/code&gt;, but it stays still when the page is scrolled. So it&#39;s really just a matter of making sure things don&#39;t overlap.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/files/fixed/fixedtopandleft.html&#34; data-no-instant&gt;Demo: Fixed top, fixed left, scrolling right&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/files/fixed/fixedtop.html&#34; data-no-instant&gt;Demo: Fixed top, scrolling bottom&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/files/fixed/fixedleft.html&#34; data-no-instant&gt;Demo: Fixed left, scrolling right&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Try resizing the page, and see how the scrolling works&lt;/strong&gt;. The templates have been tested in: Fx 3.5, IE8, IE7, IE6 (see note below), Opera 10, Safari 4; all on Windows. Let me know if you can test it on more browsers, or find bugs.&lt;/p&gt;
&lt;p&gt;You&#39;re of course free to use this templates as you see fit, with or without a link back, commercially or not. Consider it public domain.&lt;/p&gt;
&lt;h2 id=&#34;fixes-for-ie6&#34;&gt;Fixes for IE6&lt;a href=&#34;#fixes-for-ie6&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;As I&#39;ve said, these designs don&#39;t act the same in IE6. Instead of some parts being fixed, the whole page scrolls in IE6. The good thing about this is that  &lt;strong&gt;IE6 users won&#39;t see that your site is &amp;quot;broken&amp;quot;&lt;/strong&gt;, they will just get another design. And as the number of IE6 users goes towards zero, your design will be more and more consistent :). The fallback is very simple, IE6 gets &lt;code&gt;position: absolute&lt;/code&gt; instead of fixed, using the &lt;a href=&#34;http://www.webdevout.net/css-hacks#in_css-important&#34;&gt;!important hack&lt;/a&gt; (you should probably use &lt;a href=&#34;http://www.quirksmode.org/css/condcom.html&#34;&gt;conditional comments&lt;/a&gt; instead).&lt;/p&gt;
&lt;p&gt;Hope these templates are useful for some of you!&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">SpriteMe – Combine images and get fewer HTTP requests</title>
            <link href="http://friendlybit.com/css/spriteme-combine-images-and-get-fewer-http-requests/" rel="alternate" type="text/html" title="SpriteMe – Combine images and get fewer HTTP requests" />
            <published>2009-09-19T17:09:02+02:00</published>
            <updated>2009-09-19T17:09:02+02:00</updated>
            <id>http://friendlybit.com/css/spriteme-combine-images-and-get-fewer-http-requests/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Those of you that care about website performance have probably read about combining images, something that&#39;s called &#34;CSS sprites&#34;. The idea is that by using...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/spriteme-combine-images-and-get-fewer-http-requests/">
                &lt;p&gt;Those of you that care about website performance have probably read about combining images, something that&#39;s called &amp;quot;CSS sprites&amp;quot;. The idea is that by using the same (somewhat larger) image several times, you get fewer HTTP requests to your site, and therefore speed it up. Problem is, most of your images are CSS background images, that are positioned using clever background-positions and repeats.&lt;/p&gt;
&lt;p&gt;Now, this makes to tricky to combine images. Something that repeats horizontally can&#39;t be combined with something that repeats vertically (unless there&#39;s transparency involved), and wide images can&#39;t be combined with narrow ones. So combining is usually tedious, manual work, both to combine the images and then calculate the new background-positions required.&lt;/p&gt;
&lt;p&gt;Lucky for us then, that there is a tool called &lt;a href=&#34;http://spriteme.org/&#34;&gt;SpriteMe&lt;/a&gt;, available as a bookmarklet (a bookmark containing javascript), and as an excellent &lt;a href=&#34;http://spriteme.org/demo.php&#34;&gt;online demo&lt;/a&gt; that walks you through how it works. SpriteMe does all the hard work for you, you just have to copy and paste both the combined images, and the new background rules, to your site.&lt;/p&gt;
&lt;p&gt;Decreasing the number of HTTP requests have never been simpler. Well done &lt;a href=&#34;http://www.stevesouders.com/&#34;&gt;Steve Souders&lt;/a&gt;!&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Techniques to use when IE6 dies</title>
            <link href="http://friendlybit.com/css/techniques-to-use-when-ie6-dies/" rel="alternate" type="text/html" title="Techniques to use when IE6 dies" />
            <published>2009-08-26T23:54:51+02:00</published>
            <updated>2009-08-26T23:54:51+02:00</updated>
            <id>http://friendlybit.com/css/techniques-to-use-when-ie6-dies/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Everyone except Microsoft themselves are talking about the death of IE6. I&#39;ve tried motivating people to drop support, arguing that you at least can show...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/techniques-to-use-when-ie6-dies/">
                &lt;p&gt;Everyone &lt;a href=&#34;http://www.eweek.com/c/a/Windows/Microsoft-Internet-Explorer-6-Support-Continues-Despite-Calls-for-PhaseOut-307122/&#34;&gt;except Microsoft themselves&lt;/a&gt; are talking about the death of IE6. I&#39;ve tried &lt;a href=&#34;/browsers/motivation-for-building-for-ie6/&#34;&gt;motivating people to drop support&lt;/a&gt;, arguing that you at least can show IE6 users a message. Many have replied with &amp;quot;but our IT department doesn&#39;t let us…&amp;quot;, and I can say nothing more than that the IT department is filled with humans. Which means they are lazy, and upgrade when people whine enough about it. It&#39;s a shame it has to be that way, that we have to &lt;a href=&#34;http://www.ie6nomore.com/corporate-users.html&#34;&gt;punish people for their IT departments&lt;/a&gt;, but that&#39;s how it has to be.&lt;/p&gt;
&lt;p&gt;As &lt;strong&gt;web developers&lt;/strong&gt;, we should be the ones complaining the loudest. We have so much to win on IE6:s death it&#39;s silly. Just look at the below list of things IE6 can&#39;t do, but IE7 can (the next worst browser):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Native PNG alpha transparency without silly hacks.&lt;/li&gt;
&lt;li&gt;Several selectors: Child selector (&amp;quot;&amp;gt;&amp;quot;), Adjacent sibling selector (&amp;quot;+&amp;quot;), Attribute selectors ([attr=value]), and &lt;a href=&#34;http://www.w3.org/TR/css3-selectors/#general-sibling-combinators&#34;&gt;General sibling selector&lt;/a&gt; (&amp;quot;~&amp;quot;, CSS3)&lt;/li&gt;
&lt;li&gt;Min-height, Max-height, Min-width, Max-width&lt;/li&gt;
&lt;li&gt;Multiple class/id selectors in the same ruleset (ie. .class1.class2 { … })&lt;/li&gt;
&lt;li&gt;:hover on all elements, not just links&lt;/li&gt;
&lt;li&gt;position: fixed&lt;/li&gt;
&lt;li&gt;Native XMLHTTP (Without ActiveX)&lt;/li&gt;
&lt;li&gt;International Domain Names (IDN), the ability to use UTF-8 chars in domains&lt;/li&gt;
&lt;li&gt;Page zoom that zooms the whole page (don&#39;t worry about zoom)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is a huge step forward for us web developers. Huge! Bigger then when CSS3 comes out, because we won&#39;t be able to use that one for years. Someone is pushing the front of what&#39;s possible, I&#39;m pushing for the front of what&#39;s &lt;strong&gt;usable&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;What can you do to help me get everything in the above list? And, did I forget something?&lt;/p&gt;
&lt;p&gt;Sources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.quirksmode.org/css/contents.html&#34;&gt;CSS Compatibility charts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://blogulate.com/content/new-features-of-internet-explorer-7/&#34;&gt;IE6 vs IE7 - New features in Internet Explorer 7&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">A couple of sites I’ve launched</title>
            <link href="http://friendlybit.com/css/a-couple-of-sites-ive-launched/" rel="alternate" type="text/html" title="A couple of sites I’ve launched" />
            <published>2009-02-16T18:18:02+01:00</published>
            <updated>2009-02-16T18:18:02+01:00</updated>
            <id>http://friendlybit.com/css/a-couple-of-sites-ive-launched/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Lots of opinions here lately, and very few concrete examples of work I&#39;ve done. I thought I&#39;d take a few minutes of your time and talk about those projects...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/a-couple-of-sites-ive-launched/">
                &lt;p&gt;Lots of opinions here lately, and very few concrete examples of work I&#39;ve done. I thought I&#39;d take a few minutes of your time and talk about those projects here.&lt;/p&gt;
&lt;p&gt;All of the sites I&#39;ve built are in &lt;strong&gt;Swedish&lt;/strong&gt;. The reason for Swedish is just that they are so much easier to write for. Since English is not my native language, everything takes a little bit longer when having to struggle with vocabulary.&lt;/p&gt;
&lt;p&gt;All of the sites are built with &lt;strong&gt;Django&lt;/strong&gt;, a framework I&#39;ve had great success with, which feels both well architectured and easy to get started with (a very unusual combination). Django also lets me write the HTML I want, without getting in the way.&lt;/p&gt;
&lt;p&gt;(By the way: there&#39;s a &lt;a href=&#34;http://groups.google.com/group/django-stockholm&#34;&gt;Django User Group&lt;/a&gt; forming in Stockholm if you&#39;re interested. First meeting this friday)&lt;/p&gt;
&lt;h2 id=&#34;uttrakadse&#34;&gt;Uttråkad.se&lt;a href=&#34;#uttrakadse&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The first one to launch was &lt;a href=&#34;http://www.uttr%C3%A5kad.se&#34;&gt;Uttråkad.se - hitta saker att göra&lt;/a&gt;, a site for everyone that have too much time on their hands. I guess the english version would be &amp;quot;bored.com&amp;quot;, which kinda tells you what the site is about, right? :) Anyway, we&#39;ve played around with having the site very open, with no registration needed at all.&lt;/p&gt;
&lt;p&gt;I would say the launch has been a good one, with an &lt;a href=&#34;http://www.metro.se/se/article/2008/12/16/19/0353-45/index.xml&#34;&gt;article in metro&lt;/a&gt; the first week of launch, 153 activities posted, and about 70 daily unique visitors. It has been a fun project to be a part of, and it&#39;s been developed together with three friends in a group we call &lt;a href=&#34;http://openworks.se&#34;&gt;openworks&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Are you bored? Then play around with Uttråkad a bit :)&lt;/p&gt;
&lt;h2 id=&#34;kundose&#34;&gt;Kundo.se&lt;a href=&#34;#kundose&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;With our first project barely launched we decided to join an even called 24 hour business camp. The idea was simple: prepare a business idea, and build and launch it in 24 hours. Said and done: 92 entrepreneurs gathered at a luxurious conference center and presented 52 new sites 24 hours later. It was simply the best conference I&#39;ve been to, and an extreme energy boost to be in a group of doers like that.&lt;/p&gt;
&lt;p&gt;Anyway, we launched &lt;a href=&#34;http://kundo.se&#34;&gt;Kundo - kundtjänst på nätet&lt;/a&gt; after 24 hours, a site that companies can use to embed a feedback-widget on their site. Translates to something like &amp;quot;CustomerO.com&amp;quot;, it&#39;s clearly influenced from &lt;a href=&#34;http://getsatisfaction.com/&#34;&gt;Getsatisfaction&lt;/a&gt; but in Swedish.  There&#39;s clearly a need for better ways for companies to communicate with their customers in Sweden too.&lt;/p&gt;
&lt;p&gt;After the camp we still had some bugs and important features missing, so yesterday me and Björn sat down and squashed all the major ones. So, do you know of a company that needs to take better care of their customers? For free. Send them a link to &lt;a href=&#34;http://kundo.se&#34;&gt;Kundo&lt;/a&gt;. Thanks! :)&lt;/p&gt;
&lt;h2 id=&#34;samhallsentreprenorse&#34;&gt;Samhallsentreprenor.se&lt;a href=&#34;#samhallsentreprenorse&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I&#39;ve also been busy with Django at work. &lt;a href=&#34;http://www.samhallsentreprenor.se/&#34;&gt;Samhallsentreprenor.se&lt;/a&gt; is a meeting place for people that work in projects that somehow help their local (or global) community. These are people that are incredibly motivated to do good, a group that&#39;s of course great to work for.&lt;/p&gt;
&lt;p&gt;We&#39;ve released new versions of the site about every 10 days, so development is fast, and through the development blog people can directly influence future features.&lt;/p&gt;
&lt;p&gt;So, do you have ideas for projects that can help people around you? &lt;a href=&#34;http://samhallsentreprenor.se/&#34;&gt;Sign up on the site and start talking to people&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;two-more-projects&#34;&gt;Two more projects…&lt;a href=&#34;#two-more-projects&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;… are under development and will be announced when they are done. There&#39;s no lack of things to do in my world :)&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Interface developers and security</title>
            <link href="http://friendlybit.com/css/interface-developers-and-security/" rel="alternate" type="text/html" title="Interface developers and security" />
            <published>2009-01-24T00:30:44+01:00</published>
            <updated>2009-01-24T00:30:44+01:00</updated>
            <id>http://friendlybit.com/css/interface-developers-and-security/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">You live in a new era, when demanding that people register on your site is no longer enough. There&#39;s far too many other sites out that that you&#39;re already a...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/interface-developers-and-security/">
                &lt;p&gt;You live in a &lt;strong&gt;new era&lt;/strong&gt;, when demanding that people register on your site is no longer enough. There&#39;s far too many other sites out that that you&#39;re already a member of, you don&#39;t need another one. You need to trust people.&lt;/p&gt;
&lt;p&gt;You also want people to contribute to your sites with content somehow. Text is not enough, you want all kinds of &amp;quot;rich&amp;quot; content, and you want people to be able to place them how they want on your page. I mean, we live in a &lt;strong&gt;new era&lt;/strong&gt; after all.&lt;/p&gt;
&lt;p&gt;Problem is, this &lt;strong&gt;new era thingie talk&lt;/strong&gt; makes people forget the basics. Even though this is the future, and we&#39;re all bored with &amp;quot;just&amp;quot; hypertext, we can&#39;t allow random people to add HTML to our sites. Why? Ask myspace about the &lt;a href=&#34;http://namb.la/popular/tech.html&#34;&gt;Samy worm&lt;/a&gt; from 2005, a little piece of clever front-end code that took their servers flying. What did they do wrong? They tried to let untrusted people embed HTML on their profile pages.&lt;/p&gt;
&lt;p&gt;But they even had this clever filter, which cleaned the code first! Well, long story short, using a div with the style attribute set to a background image that points to a javascript url actually execute the javascript in IE6. Didn&#39;t think of that did you? So what about the fact that both IE6 and IE7 execute vbscripts in urls prefixed with &amp;quot;vbscript:&amp;quot;, just like with javascript. Didn&#39;t know that? Ohhh. Perhaps then you shouldn&#39;t be trying to let unknown people embed HTML on your site?&lt;/p&gt;
&lt;p&gt;Many of these security issues stem from the fact that ordinary well-educated computer scientists &lt;strong&gt;don&#39;t know enough about interface development&lt;/strong&gt;, HTML, CSS and javascript, and discount them as being something that &amp;quot;anyone&amp;quot; could do. &amp;quot;Even my aunt made this puppy site in like 3 days, how hard can it be?!&amp;quot;.&lt;/p&gt;
&lt;p&gt;I&#39;ve always thought that interface development have an undeserved reputation of being easier than &amp;quot;real programming&amp;quot;; something that you can let rookies work with, something that no &amp;quot;real&amp;quot; programmer would ever want. &amp;quot;No, I want to work with hard stuff, not that webby stuff&amp;quot;.&lt;/p&gt;
&lt;p&gt;If you are in a position where people actually think that, perhaps security could be the way to lift interface development to its proper status. So why not read up on &lt;a href=&#34;http://en.wikipedia.org/wiki/Cross-site_scripting&#34;&gt;Cross Site Scripting (XSS)&lt;/a&gt;, look at examples of vulnerabilities, and pick a couple of examples of &lt;a href=&#34;http://www.xssed.com/&#34;&gt;big sites that are vulnerable&lt;/a&gt;. While you&#39;re at it, why not read up on &lt;a href=&#34;http://en.wikipedia.org/wiki/Cross-site_request_forgery&#34;&gt;Cross-site request forgery (CSRF)&lt;/a&gt; too?&lt;/p&gt;
&lt;p&gt;These are real issues that &lt;strong&gt;someone&lt;/strong&gt; needs to take into account when building websites. My guess is that the fancy computer scientists will have a very long way to go before grasping this stuff. &amp;quot;Why does IE6 parse &#39;java   script:&#39; as if there where no space in the middle?&amp;quot;. You know who&#39;s not surprised? Every damn interface developer out there.&lt;/p&gt;
&lt;p&gt;So. Go out there, and teach them silly math people how it&#39;s done, and what your HTML, CSS and javscript-knowledge is worth. Show them that logic isn&#39;t the way we do things around here, that anything can happen when IE6 boots. And… whatever you do… think very hard before letting people embed HTML on your site.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">OpenID, Nofollow removed, Comment counts, and IE7 fixes</title>
            <link href="http://friendlybit.com/css/openid-nofollow-removed-comment-counts-and-ie7-fixes/" rel="alternate" type="text/html" title="OpenID, Nofollow removed, Comment counts, and IE7 fixes" />
            <published>2008-10-19T15:48:03+02:00</published>
            <updated>2008-10-19T15:48:03+02:00</updated>
            <id>http://friendlybit.com/css/openid-nofollow-removed-comment-counts-and-ie7-fixes/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">I&#39;m added a few features to the site: OpenID support: Instead of typing your name and e-mail you could instead sign in with an OpenID-enabled URL. Or you...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/openid-nofollow-removed-comment-counts-and-ie7-fixes/">
                &lt;p&gt;I&#39;m added a few features to the site:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;OpenID support&lt;/strong&gt;: Instead of typing your name and e-mail you could instead sign in with an OpenID-enabled URL. Or you could completely ignore it, and go on as usual.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Nofollow restriction removed&lt;/strong&gt;: WordPress by default adds rel=&amp;quot;nofollow&amp;quot; to all links that people write in comments. It&#39;s a good way to decrease the impact of spam. Thing is, I strictly moderate comments, and have three plugins that prevent spam (Akismet, Spam Karma 2, and Bad Behavior). Since spam really isn&#39;t a problem, I&#39;ve decided to remove the nofollow from your links, if you&#39;ve posted more than three comments.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Comment counts&lt;/strong&gt;: To make it easier to see who you can trust and not in the comments I&#39;ve added a comment count next to the name. Damn, I&#39;ve commented a lot :)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;IE7 fixes&lt;/strong&gt;: There were script errors in IE7 since I&#39;m trying to do funky stuff with opacity on the search field. I&#39;ve fixed that. Also, the number of subscribers wasn&#39;t visible in IE7. They are now.&lt;/p&gt;
&lt;p&gt;Over and out.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">IE7 hover bug: z-index ignored (and other properties)</title>
            <link href="http://friendlybit.com/css/ie7-hover-bug-z-index-ignored-and-other-properties/" rel="alternate" type="text/html" title="IE7 hover bug: z-index ignored (and other properties)" />
            <published>2008-10-12T20:17:04+02:00</published>
            <updated>2008-10-12T20:17:04+02:00</updated>
            <id>http://friendlybit.com/css/ie7-hover-bug-z-index-ignored-and-other-properties/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">I&#39;m implementing a rather different design right now for an intranet, and have found a bug I thought you&#39;d like to know about. If you restyle things with...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/ie7-hover-bug-z-index-ignored-and-other-properties/">
                &lt;p&gt;I&#39;m implementing a rather different design right now for an intranet, and have found a bug I thought you&#39;d like to know about. If you restyle things with :hover, you might have to add an extra property for the rule to be applied in IE7.&lt;/p&gt;
&lt;p&gt;How is this design different? Well, it built on columns that are overlapping each other. When you hover one of the columns, that column get placed on top (temporarily). You think you need javascript for this? You don&#39;t (if you can live with not supporting IE6).&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;menu&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;sidebar&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;z-index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;menu&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nd&#34;&gt;hover&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nd&#34;&gt;hover&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;sidebar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nd&#34;&gt;hover&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;z-index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Simple isn&#39;t it? Now you just have to absolutely position the three columns. By the way, working with absolute positioning is ok as long as you don&#39;t need a cleared footer below the three columns. Strange that not more people use this.&lt;/p&gt;
&lt;p&gt;Anyway, the above doesn&#39;t work in IE7. It should, because IE7 supports :hover on all elements, including my &amp;quot;div columns&amp;quot;. Some googling led me to an old IE6 bug where some elements are ignored on links. The bug talks about IE6 and the color property being ignored, but the same seems to apply to IE7 and z-index.&lt;/p&gt;
&lt;p&gt;So, long story short, just add &lt;code&gt;display: block&lt;/code&gt; to the hover rule and everything works fine. As the link above dictates, many different rules work, the important thing is that it must be a new rule, which you &lt;strong&gt;haven&#39;t used before&lt;/strong&gt; on that element. But you don&#39;t set display: block; on divs, do you? So it should work fine.&lt;/p&gt;
&lt;p&gt;Hope it helps some frustrated soul out there :) And long live funky designs.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Yellow fade with CSS and a simple image</title>
            <link href="http://friendlybit.com/css/yellow-fade-with-css-and-a-simple-image/" rel="alternate" type="text/html" title="Yellow fade with CSS and a simple image" />
            <published>2008-10-04T20:19:09+02:00</published>
            <updated>2008-10-04T20:19:09+02:00</updated>
            <id>http://friendlybit.com/css/yellow-fade-with-css-and-a-simple-image/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Via Think Vitamin I find a cool way to highlight the current element. Lots of people do this by calling some kind of javascript library, it&#39;s so common it&#39;s...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/yellow-fade-with-css-and-a-simple-image/">
                &lt;p&gt;Via &lt;a href=&#34;http://www.thinkvitamin.com/features/css/stay-on-target&#34;&gt;Think Vitamin&lt;/a&gt; I find a cool way to highlight the current element. Lots of people do this by calling some kind of javascript library, it&#39;s so common it&#39;s been dubbed the &lt;a href=&#34;http://www.37signals.com/svn/archives/000558.php&#34;&gt;yellow fade technique&lt;/a&gt;. But javascript isn&#39;t really needed, you just need CSS and an image.&lt;/p&gt;
&lt;p id=&#34;example&#34;&gt;
  First: you can jump to any id on the current page by appending #some-id-here to the url. This includes all the &#34;semantic&#34; ids you&#39;ve added to the page such as #content, #sidebar, and so on. Very useful if you want to point out a certain section of a page to a friend, just look at the source, try to find an id nearby, and add it to the url.
&lt;/p&gt;

&lt;p&gt;If you want to make things even easier on your own site, you can visually highlight things that get referenced via the above method. That&#39;s where the :target psuedo selector jumps in to save your day. Please note that :target is CSS3, and only currently works in &lt;a href=&#34;http://reference.sitepoint.com/css/pseudoclass-target&#34;&gt;non-crap browsers&lt;/a&gt;. But perhaps this effect is something not all users really need?&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nd&#34;&gt;target&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mh&#34;&gt;#234af5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This highlights all links that get referenced via the URL with a nice blue color. So they need an id added. Makes perfect sense for all kinds of documentation where you want to refer someone to a certain method or even sentence.&lt;/p&gt;
&lt;p&gt;But it gets better:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nd&#34;&gt;target&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;/images/yellow-fade.gif&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We&#39;ve removed the limit of only targeting links with by using :target straight off. So all targeted elements will get affected by this rule. What next? Well, we use a small animated image to fade from one color to the next. It&#39;s a really easy way to add dynamics to a page.&lt;/p&gt;
&lt;p&gt;Try the effect by &lt;a href=&#34;#example&#34;&gt;jumping to the code example&lt;/a&gt; above.&lt;/p&gt;
&lt;p&gt;I really think this makes internal links a whole lot more useful, especially for jumping to the bottom of the page, where it&#39;s not possible for the browser to scroll down enough to get the targeted element to the top. Needless to say, I&#39;ve added this effect to this site too. Hope you can find something to use it for too.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">The Open Web: Can it deliver?</title>
            <link href="http://friendlybit.com/css/the-open-web-can-it-deliver/" rel="alternate" type="text/html" title="The Open Web: Can it deliver?" />
            <published>2008-09-01T22:58:08+02:00</published>
            <updated>2008-09-01T22:58:08+02:00</updated>
            <id>http://friendlybit.com/css/the-open-web-can-it-deliver/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">It&#39;s ringing through my head as Microsoft releases Silverlight, as Adobe forces another version of Flash or Air, and as Sun tries to push JavaFX into the...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/the-open-web-can-it-deliver/">
                &lt;p&gt;It&#39;s ringing through my head as Microsoft releases Silverlight, as Adobe forces another version of Flash or Air, and as Sun tries to push JavaFX into the spotlight. It&#39;s a dark whisper when I read how many still use old browsers (hello IE6!), or when I see Javascript being used poorly by otherwise knowledgeable programmers. It&#39;s getting obvious when people complain over how hard and hacky HTML and CSS is.&lt;/p&gt;
&lt;p&gt;People are simply not getting their job done fast enough. Just because we&#39;ve hacked and hacked to the point of getting used to it, doesn&#39;t mean our way of writing web apps is the best way. In the end it about delivering to end users or paying clients, and they care more about &lt;strong&gt;what&lt;/strong&gt; you deliver than &lt;strong&gt;how&lt;/strong&gt;. I&#39;m not saying we are working slower than before, it&#39;s the opposite, new tools makes web development less annoying. But I am saying that we get less work done in relation to the expectations.&lt;/p&gt;
&lt;p&gt;So what do they expect? Well, they want flashy effects. The want application behavior. They want snappy response times, bright colors, and &amp;quot;Wow!&amp;quot;-reactions. For our clients, the web is getting more crowded every day and they need to fight harder and harder for people&#39;s attention. That means you need to fight harder on their behalf.&lt;/p&gt;
&lt;p&gt;Say you are a pro open standards developer, like me. What tools do you have to grab people&#39;s attention? Valid HTML? DIVs with fading color? AJAX? No way man. A good Flash developer can get a wow reaction by the time you&#39;ve chosen doctype (or at least by the time you&#39;ve booted IE6).&lt;/p&gt;
&lt;p&gt;So you turn to Google, and look for the latest and hottest in standards development. And you find that you need to use Javascript and Flash (sIFR) to render custom fonts. You find that you need to use (Adobe) Photoshop to add highlights and shadows on your headers. You find that you have to hack severely to be able to use alpha transparent images. To do any kind of animation, you need a big Javascript library, because browser makers have not yet (yes, it&#39;s 2008) been able to collaborate on how the language should work.&lt;/p&gt;
&lt;p&gt;You say that standards have to take time. That everyone needs to come together and thoroughly discuss important issues. The right committees and councils needs to be formed. Meanwhile Microsoft prepares for the release of Silverlight 2.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Have you no sense of urgency?&lt;/strong&gt;&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Why adding variables to CSS is a good thing</title>
            <link href="http://friendlybit.com/css/why-adding-variables-to-css-is-a-good-thing/" rel="alternate" type="text/html" title="Why adding variables to CSS is a good thing" />
            <published>2008-08-07T16:29:24+02:00</published>
            <updated>2008-08-07T16:29:24+02:00</updated>
            <id>http://friendlybit.com/css/why-adding-variables-to-css-is-a-good-thing/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Via Simon Willison I find that Bert Bos, one of the creators of CSS, has written an article on why variables shouldn&#39;t be included in CSS3. I thought I&#39;d...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/why-adding-variables-to-css-is-a-good-thing/">
                &lt;p&gt;Via Simon Willison I find that Bert Bos, one of the creators of CSS, has written an article on why &lt;a href=&#34;http://www.w3.org/People/Bos/CSS-variables&#34;&gt;variables shouldn&#39;t be included in CSS3&lt;/a&gt;. I thought I&#39;d try to explain why I think &lt;strong&gt;they should&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&#34;professional-perspective&#34;&gt;Professional perspective&lt;a href=&#34;#professional-perspective&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Bert posts statistics of stylesheet usage from the W3C site, and means that most stylesheets are very small, and on those, variables are not really needed. I agree. You can get away with simple search-replace in those simple cases. But Bert also finds that there are bigger sheets: &amp;quot;largest hand-written style sheet: 1462 lines (bought from a Web design company)&amp;quot;. I work at one of those companies, and almost all CSS files I write exceed 1000 lines.&lt;/p&gt;
&lt;p&gt;In those cases, I think CSS variables would help me a lot. Especially for margins. Matching several margins together by copying the same value over and over again isn&#39;t maintainable. Search replace on a pixel value is a sure way to mess up your whole stylesheet: who says you only use 5px for those margins? So &lt;strong&gt;there is&lt;/strong&gt; a use case for some kind of variables.&lt;/p&gt;
&lt;h2 id=&#34;so-we-need-variables-but-how&#34;&gt;So we need variables, but how?&lt;a href=&#34;#so-we-need-variables-but-how&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Bert then suggests that those people should use a solution such as &lt;a href=&#34;http://interfacelab.com/variables-in-css-via-php/&#34;&gt;PHP to generate CSS&lt;/a&gt;. So we should invent a new language for generating CSS with PHP? And another language for generating CSS from Ruby, from Java, from .NET, and so on. Why shouldn&#39;t we go this way? It&#39;s the path HTML has taken. And this is a hard nut to crack. How is CSS different from HTML? Why should CSS have variables when HTML doesn&#39;t?&lt;/p&gt;
&lt;p&gt;I think the answer is that we should add variables to both languages. They are very similar in nature, so they should be treated the same. Because what has changed since when CSS was created is that we&#39;ve started building bigger and more complex sites. And if CSS starts to be too cumbersome to use, people will start looking elsewhere, to Flash, Air, Silverlight and so on. CSS needs to adapt to the more complex sites people are building today.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I&#39;d rather see CSS follow the times and add variables, than seeing frustrated professionals move to proprietary technologies&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&#34;so-what-about-beginners&#34;&gt;So what about beginners?&lt;a href=&#34;#so-what-about-beginners&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Bert&#39;s article deals a lot with beginners, and how it will be harder for them to understand another level of abstraction. Lets make it clear at first that CSS already is too hard for beginners. To make a very simple layout you need to understand floats (yes, almost everyone needs columns), and floating is really confusing (ever tried to explain float/clear to someone?). Even for someone like me, who has worked with CSS for years, floats still puzzle me regularly.&lt;/p&gt;
&lt;p&gt;People will give up on CSS when they encounter floats (yes, I&#39;ve seen this), not when they find CSS variables. They can just choose not to use variables, while they really need to know floats. Also, CSS variables are easier to understand than cascading values. I mean really, if I set font-size on body, why do my links get larger? That&#39;s a very similar concept that is central to CSS.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary&lt;a href=&#34;#summary&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;CSS Variables make it easier for professionals to do their job. It doesn&#39;t require inventing new template languages. It doesn&#39;t make the language overall harder either. The people that can handle floats and cascading, can handle variables too. &lt;strong&gt;We need variables&lt;/strong&gt;.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Don’t waste time writing HTML and CSS</title>
            <link href="http://friendlybit.com/css/dont-waste-time-writing-html-and-css/" rel="alternate" type="text/html" title="Don’t waste time writing HTML and CSS" />
            <published>2008-07-10T00:02:50+02:00</published>
            <updated>2008-07-10T00:02:50+02:00</updated>
            <id>http://friendlybit.com/css/dont-waste-time-writing-html-and-css/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">When you&#39;ve worked with front-end development for a while, you start thinking about effectiveness. So without further ado, here&#39;s my four best ways to be a...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/dont-waste-time-writing-html-and-css/">
                &lt;p&gt;When you&#39;ve worked with front-end development for a while, you start thinking about effectiveness. So without further ado, here&#39;s my four best ways to be a more effective front-end developer. Feel free to add more ideas as comments!&lt;/p&gt;
&lt;h2 id=&#34;1-do-you-need-html-or-css-for-this&#34;&gt;1. Do you need HTML or CSS for this?&lt;a href=&#34;#1-do-you-need-html-or-css-for-this&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Lots of times when I get stranded on hard problem and sit back, I realize that I really &lt;strong&gt;shouldn&#39;t be trying to use CSS to solve all layout problems&lt;/strong&gt;. Assuming a rounded corner box will have to scale in all directions (up to 8 images!), when it really is fixed width and height (1 image), is an indescribable waste of everyone&#39;s time. Look closely at the design you&#39;re trying to implement: does it really have to be as flexible and scalable as you think? Shifting to that mindset saves me hours of work per day.&lt;/p&gt;
&lt;p&gt;One thing that many developers forget is that not all designers care for exact pixels. If something is really hard to develop, walk over to their table and suggest a change. You&#39;ll soon start to notice that designers are real people too, and that they have as much flexibility as you do. It&#39;s just as easy to call them up, so don&#39;t let shyness waste your time.&lt;/p&gt;
&lt;h2 id=&#34;2-try-to-set-properties-once&#34;&gt;2. Try to set properties once&lt;a href=&#34;#2-try-to-set-properties-once&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When you know you have to do something (see above), try to &lt;strong&gt;do things once&lt;/strong&gt;. This is really tricky in both HTML and CSS, languages that have no variables, and generally makes code reuse a pain. But it is possible.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;With CSS&lt;/strong&gt;; set widths of elements once, and trust inner elements to fill their parent. That&#39;s the default behavior of block level elements, and you can set display: block, or width: 100% on most other elements. Don&#39;t set heights at all if you can avoid them, and let elements expand to fill their containers. Combine similar CSS selectors to avoid typing things twice, and make new ones for common properties when few properties differ. Use floats and clearing instead of absolute positioning, and you&#39;ll won&#39;t have to micromanage positions all the time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;With HTML&lt;/strong&gt;, make sure that you really know the template language. I&#39;ve fighted with ASP.NET, JSP, JSTL, Smarty, WordPress Themes, RHTML, and Django&#39;s Templating Language, and now know enough about all of them to be productive. You should never have to type the same structure out twice, even in HTML. If your template language have loops, if-clauses and includes you really have no excuse to copy large chunks of HTML around. Refactor your HTML and make your own life easy.&lt;/p&gt;
&lt;h2 id=&#34;3-learn-your-text-editor&#34;&gt;3. Learn your text editor&lt;a href=&#34;#3-learn-your-text-editor&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When code reuse isn&#39;t possible, &lt;strong&gt;use search/replace&lt;/strong&gt; in your favorite text editor.&lt;/p&gt;
&lt;p&gt;Replacing all instances of one HTML tag name with another is about replacing &amp;quot;element&amp;gt;&amp;quot; with &amp;quot;element2&amp;gt;&amp;quot; (without the opening bracket). That way you replace both opening and ending tags at once. Check to see if your editor supports regular expressions in its search/replace tool. If it does you can save lots of time by learning it. Matching a HTML tag is &amp;quot;&amp;lt;[^&amp;gt;]+&amp;gt;&amp;quot;, a starting angel bracket, one or more non-brackets, followed by an ending angel bracket. Naive regexps can make you match the starting bracket of one tag and the end of another, which makes for a mess.&lt;/p&gt;
&lt;p&gt;There&#39;s lots of little tricks like that, if you learn them you save massive amounts of time.&lt;/p&gt;
&lt;h2 id=&#34;4-make-sure-your-environment-supports-you&#34;&gt;4. Make sure your environment supports you&lt;a href=&#34;#4-make-sure-your-environment-supports-you&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There&#39;s more than the text editor that you have to work with. One essential part of front-end development is trial and error. It sounds silly but no matter what your skill is, sometimes you must resort to trying and testing your way to a solution. With HTML and CSS, this means being able to &lt;strong&gt;quickly make a change, switch window, and see that change in the browser&lt;/strong&gt;. If that cycle takes more that 5 seconds, you&#39;re losing valuable time.&lt;/p&gt;
&lt;p&gt;Don&#39;t use a virtual machine (even if it&#39;s only for IE6) that you can&#39;t quickly Alt-Tab out of. If you&#39;re stuck using one, you need to have the text editor on that machine too. It&#39;s worth your time fixing it.&lt;/p&gt;
&lt;p&gt;Don&#39;t accept build processes that makes you wait more than 5-10 seconds before you see your changes. With trial and error coding you will then waste 50% of your capacity doing nothing. Most often you can bypass this by copying just the HTML and CSS to the right place, without touching other source-code. I&#39;ve managed to do this in all kinds of crappy environments, and it&#39;s always worth it.&lt;/p&gt;
&lt;p&gt;So.&lt;/p&gt;
&lt;p&gt;I hope some of the above can help you save some time each day. The little things add up you know. What&#39;s your best time-saver?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Upside down text with CSS</title>
            <link href="http://friendlybit.com/css/upside-down-text-with-css/" rel="alternate" type="text/html" title="Upside down text with CSS" />
            <published>2008-06-26T22:34:31+02:00</published>
            <updated>2008-06-26T22:34:31+02:00</updated>
            <id>http://friendlybit.com/css/upside-down-text-with-css/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Previously I&#39;ve talked about reversing text with CSS by simply setting a few CSS attributes. Today we will try another trick: turning text upside down. It&#39;s...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/upside-down-text-with-css/">
                &lt;p&gt;Previously I&#39;ve talked about &lt;a href=&#34;/css/reverse-text-with-css-32-very-special-hex-digits/&#34;&gt;reversing text with CSS&lt;/a&gt; by simply setting a few CSS attributes. Today we will try another trick: turning text &lt;strong&gt;upside down&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;It&#39;s actually possible using a simple CSS property and works cross-browser today. The property to use it &amp;quot;text-gravity&amp;quot; with a value of &amp;quot;inverse&amp;quot;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;span&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;text-gravity: inverse&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
write upside down text
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;span&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;… and this is the result:&lt;/p&gt;
&lt;p&gt;&lt;span style=&#34;text-gravity: inverse&#34;&gt;ʇxǝʇ uʍop ǝpısdn ǝʇıɹʍ&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I&#39;m really surprised to learn that so few people know about this property, and I recommend you to continue reading the &lt;a href=&#34;http://www.fliptext.info/index.php&#34;&gt;W3C specification of text-gravity&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Sorry, I lied :) The above is done with a UTF-8 character generator (see the link the the &amp;quot;specification&amp;quot; above). Amazingly, you can find that most characters have their upside down equivalent somewhere else in the huge Unicode alphabet. Neat trick :)&lt;/p&gt;
&lt;/blockquote&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Feed readers should show comments</title>
            <link href="http://friendlybit.com/css/feed-readers-should-show-comments/" rel="alternate" type="text/html" title="Feed readers should show comments" />
            <published>2008-06-15T17:25:48+02:00</published>
            <updated>2008-06-15T17:25:48+02:00</updated>
            <id>http://friendlybit.com/css/feed-readers-should-show-comments/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">One thing I&#39;ve noticed lately is that I read fewer comments. It isn&#39;t that strange really: I read blogs using a feed reader and it doesn&#39;t show a links to...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/feed-readers-should-show-comments/">
                &lt;p&gt;One thing I&#39;ve noticed lately is that I read fewer comments. It isn&#39;t that strange really: I read blogs using a feed reader and it doesn&#39;t show a links to comments. I see a couple of reasons why comments are not cared for in feed readers:&lt;/p&gt;
&lt;h2 id=&#34;why-not-1-feeds-are-meant-to-be-fast&#34;&gt;Why not #1: Feeds are meant to be fast&lt;a href=&#34;#why-not-1-feeds-are-meant-to-be-fast&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Many subscribe to feeds to be able to get news before everyone else. And getting things fast means getting it before anyone else have commented. Why add a lot of zeros below each feed item?&lt;/p&gt;
&lt;p&gt;But, it isn&#39;t unusual that &lt;strong&gt;I read posts that are a couple of days old&lt;/strong&gt;. I don&#39;t read my feeds every day, rather every second or third day. In those days there are most likely comments on good posts, and of course I don&#39;t want to miss them. The older a post is, the more likely that it will have interesting comments.&lt;/p&gt;
&lt;h2 id=&#34;why-not-2-comments-are-hard-to-detect&#34;&gt;Why not #2: Comments are hard to detect&lt;a href=&#34;#why-not-2-comments-are-hard-to-detect&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Perhaps feed readers have a hard time detecting if there are comments to a post or not. Comments are not included in the post, so wouldn&#39;t they have to parse through the feed link for comments?&lt;/p&gt;
&lt;p&gt;No, there is a tag called &lt;code&gt;&amp;lt;wfw:commentRss&amp;gt;&lt;/code&gt;, that&#39;s possible to use in both Atom and RSS (If I&#39;m not mistaken), that gives &lt;strong&gt;a link to the comment feed&lt;/strong&gt;. That means feed readers could easily get the comments too. The best thing here is that all WordPress blogs (and others too) have it already. It&#39;s just a matter of using it!&lt;/p&gt;
&lt;h2 id=&#34;why-not-3-each-post-will-be-too-long&#34;&gt;Why not #3: Each post will be too long!&lt;a href=&#34;#why-not-3-each-post-will-be-too-long&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;If there are 50 comments to a post, the item in the feed reader will be too long to read. That would also affect download time and therefore make things slow.&lt;/p&gt;
&lt;p&gt;Yes, it will mean downloading more data, but you also get more information. &lt;strong&gt;Each feed reader is free to implement comments any way they like&lt;/strong&gt;, and I doubt it will be to expand the original post with all 50 comments. I little link that expands comments (don&#39;t download any extra data until you expand)? Only show the first five, and a link to the page for more? There&#39;s lots of good options here.&lt;/p&gt;
&lt;h2 id=&#34;promote-contributions-more&#34;&gt;Promote contributions more&lt;a href=&#34;#promote-contributions-more&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Adding comments to your feed serves to promote your user&#39;s contributions even more, and I&#39;m really surprised that not everyone does it. I&#39;m using feed burner for &lt;a href=&#34;/feed/&#34;&gt;my feed&lt;/a&gt; and can therefore use a feed flair (Click your feed / Optimize / FeedFlair / Comment count) to add a link to my comments at the end of the post. That&#39;s a first step.&lt;/p&gt;
&lt;p&gt;What would be much better was if &lt;strong&gt;feed readers would get better at promoting comments&lt;/strong&gt;. Could we get them to somehow?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">New theme up for friendlybit.com</title>
            <link href="http://friendlybit.com/css/new-theme-up-for-friendlybitcom/" rel="alternate" type="text/html" title="New theme up for friendlybit.com" />
            <published>2008-05-22T01:04:54+02:00</published>
            <updated>2008-05-22T01:04:54+02:00</updated>
            <id>http://friendlybit.com/css/new-theme-up-for-friendlybitcom/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Hi! If you&#39;re reading this blog through your feed reader, today is a good day to break out of it and have a look at the site. There&#39;s been several little...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/new-theme-up-for-friendlybitcom/">
                &lt;p&gt;Hi! If you&#39;re reading this blog through your feed reader, today is a good day to break out of it and have a look at the site. There&#39;s been several little changes throughout, and I invite you to click around and explore things. &lt;strong&gt;Let me know if you find anything broken&lt;/strong&gt;!&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Comments have moved up to the top and gotten more space. That includes the comment form which have been an insult to people wanting to comment. I&#39;m hoping you reward me by correcting me even more often.&lt;/li&gt;
&lt;li&gt;I&#39;m using Google for my searches. Instead of trying to patch the builtin wordpress search I&#39;m just linking to google from the header. It gives both faster and better results.&lt;/li&gt;
&lt;li&gt;Design-wise it&#39;s much &amp;quot;lighter&amp;quot; than before. The old one felt hard and heavy, and didn&#39;t look to be as open as it in fact is.&lt;/li&gt;
&lt;li&gt;Widgetized. I&#39;m using wordpress widgets all over the place, which makes the administration of things like the &amp;quot;recent comments&amp;quot; easier. I just log in and change a number from the admin interface.&lt;/li&gt;
&lt;li&gt;Fluid width (between 1000 and 1250 pixels).&lt;/li&gt;
&lt;li&gt;Much nicer CSS, with a structure that you can actually follow.&lt;/li&gt;
&lt;li&gt;I&#39;ve &lt;a href=&#34;/other/new-design-for-friendlybit/&#34;&gt;promised&lt;/a&gt; you the number of feed readers clearly visible, and I&#39;m still going to get it done. But I&#39;m not done yet.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;No matter what I will keep what I&#39;ve always done with comments: I will read each and every comment you post, and I won&#39;t close articles for comments even though they are a year old. I will keep replying to (almost) all posts within a couple of days. I won&#39;t delete your comment just because I disagree with what you&#39;re saying, and I will go back and correct the original article with any errors you find.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You&lt;/strong&gt; are what makes this blog what it is. I could have written all my texts in word instead (and some of you probably wish I did sometimes), but that would have been totally meaningless. Feedback is what makes this blog go around.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thanks!&lt;/strong&gt;&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Style tables with CSS</title>
            <link href="http://friendlybit.com/css/style-tables-with-css/" rel="alternate" type="text/html" title="Style tables with CSS" />
            <published>2008-03-14T01:10:28+01:00</published>
            <updated>2008-03-14T01:10:28+01:00</updated>
            <id>http://friendlybit.com/css/style-tables-with-css/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">I don&#39;t deal too much with tables. Not because I don&#39;t want to but because clients hardly ever want to use them. My guess is that they are too hard to...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/style-tables-with-css/">
                &lt;p&gt;I don&#39;t deal too much with tables. Not because I don&#39;t want to but because clients hardly ever want to use them. My guess is that they are too hard to create with todays WYSIWYG editors, and therefore get left out. It happens though that I have one or two static tables I need to style, and then I get to use a couple of my tricks.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;All of the examples below work across browsers. Including IE6.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#gradient&#34;&gt;Add a gradient to your cells&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#spacing&#34;&gt;Remove the space between the cells with CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#width&#34;&gt;Obey the set width&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#columns&#34;&gt;Styling columns&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;gradient&#34;&gt;Add a gradient to your cells&lt;a href=&#34;#gradient&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;One easy way to make tables look better is to add a &lt;a href=&#34;http://9rules.com/blog/2006/08/a-gradient-tutorial/&#34;&gt;subtle gradient&lt;/a&gt; to the cells. That&#39;s easy to do. But make sure you also set a background color with one of the edge colors from the gradient, and use the top or bottom keyword. You never know the height of your cells when people zoom the text.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mh&#34;&gt;#2B2B3C&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sx&#34;&gt;item_gradient.gif&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;repeat-x&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;bottom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;spacing&#34;&gt;Remove the space between the cells with CSS&lt;a href=&#34;#spacing&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When designing tables you rarely want the ugly double border between two cells that appear when you set a border on td. Neither do you want the space in between them… Many believe the only way to remove that space is to use the cellspacing and cellpadding attributes in HTML. You don&#39;t:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;border-collapse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;collapse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;border&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;solid&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;silver&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;See? No ugly HTML attributes needed.&lt;/p&gt;
&lt;h2 id=&#34;width&#34;&gt;Obey the set width&lt;a href=&#34;#width&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Many of you have probably seen tables that do not stay within the width you have set on them. It can be long words or sometimes URLs that are wider than what can fit. By default, the browser puts content before style, and therefore expands the table to show the content. But what many don&#39;t know is that you can change them to always obey the set width:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;table-layout&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;fixed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Easy, and now the table will be 100px, no matter what.&lt;/p&gt;
&lt;h2 id=&#34;columns&#34;&gt;Styling columns&lt;a href=&#34;#columns&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Sometimes you want to style some columns differently than all other cells, and I&#39;ve seen that most people add a special class to each of the cells in that column. Wouldn&#39;t it be nice if there was a way to just specify the class once? There is!&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;col&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;first&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;col&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;second&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Header 1&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Header 2&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Cell 1&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Cell 2&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;col&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;second&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Convenient isn&#39;t it? There&#39;s one thing you should know though… The col attribute only allows &lt;a href=&#34;http://www.w3.org/TR/CSS21/tables.html#columns&#34;&gt;four attributes&lt;/a&gt;: Border, Background, Width, and Visibility. What the heck? Well, there is performance issues with implementing more complex things so W3C decided not to include it. So what if you need to set, say, text-align on a column? You can be clever:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;col&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;second&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;text-align&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nd&#34;&gt;first-child&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;text-align&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The above works because IE allows setting more properties on columns than the spec allows (&lt;a href=&#34;http://ln.hixie.ch/?start=1070385285&amp;amp;count=1&#34;&gt;Hixie explains it well&lt;/a&gt;). Firefox on the other hand, ignores the set text-align, but instead allows you to use a sibling selector to select the &amp;quot;second td after the first one&amp;quot; (you can add another &amp;quot;+ td&amp;quot; to select the third one, and so on…). Voilá! Cross browser column specification.&lt;/p&gt;
&lt;p&gt;That&#39;s all for now, did you know all of them?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Documenting CSS</title>
            <link href="http://friendlybit.com/css/documenting-css/" rel="alternate" type="text/html" title="Documenting CSS" />
            <published>2008-02-27T23:55:00+01:00</published>
            <updated>2008-02-27T23:55:00+01:00</updated>
            <id>http://friendlybit.com/css/documenting-css/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Just like all other programming the CSS needs documentation. I&#39;m afraid I&#39;m rather bad at it: the times I&#39;m lucky I&#39;ve been able to document by simply...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/documenting-css/">
                &lt;p&gt;Just like all other programming the &lt;strong&gt;CSS needs documentation&lt;/strong&gt;. I&#39;m afraid I&#39;m rather bad at it: the times I&#39;m lucky I&#39;ve been able to document by simply talking to the developer taking over, and the unlucky times I&#39;ve left no documentation at all. Talking directly is of course superior to everything else, you don&#39;t waste time explaining things that are obvious (differs from person to person), but you don&#39;t always have that luxury. So what I thought I&#39;d do is list things I think are important to document, for the times when you won&#39;t be available for answering questions.&lt;/p&gt;
&lt;p&gt;Don&#39;t be fooled to think all projects are alike. Sometimes you&#39;re under tremendous stress just to get the basic CSS up and running; it isn&#39;t reasonable to expect the same kind of documentation then… But most often you have an hour extra to just jot down a couple of lines about your interface.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;How is the CSS file(s) structured?&lt;/strong&gt; When you build large sites you often end up with over 1000 lines of CSS, and if you don&#39;t structure them, you&#39;ll end up with a mess. Even if you DO have a structure, it takes a lot of time to figure out someone else&#39;s code. To give you some ideas of your own, I wrote about how I &lt;a href=&#34;/css/how-to-structure-large-css-files/&#34;&gt;structure my CSS&lt;/a&gt; previously. You don&#39;t have to use that one, just be conscious about your choice, and document it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Where do I add new styles?&lt;/strong&gt; Either it&#39;s obvious from the previous structure or you need to make it obvious how to add new stuff. What if I&#39;m adding a deviation from how a certain section looks, should I put it near that section&#39;s styles, or near all other deviations? This question is especially important on sites with lots of campaign components with custom CSS. Trust me, your cleverly crafted structure will become a mess if you miss answering this question.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What can I do with existing styles?&lt;/strong&gt; To make sure design ends up in the CSS and not in the HTML there needs to be some kind of overview of all available classes. Else people are going to hack things and try to duplicate your code. How do you handle columns, clearing, quotes, and floated images? Did you think of it yourself or do I have to add my own code? A good way might be to make a document where you tie the different classes to how they look when used.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;How are different browsers handled?&lt;/strong&gt; Struggling through browser hacks is a real pain in the ass, unless those hacks are properly documented. What browsers do you try to support, and which of them have you tested in? Did you plan for the future?&lt;/li&gt;
&lt;li&gt;(Optional) &lt;strong&gt;Web standard basics&lt;/strong&gt;. Working with web standards is rather different than working the old (table based) way . So if you know that oldschool developers will work with your code (are you sure they won&#39;t?), it could be a good idea to shortly summarize the modern web mindset. I recommend using a lot of links here, not to waste time; people are very different in what they know.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you&#39;ve answered the questions able you&#39;ve come a long way. Your code is understandable, and will stay in shape for much longer. Not to mention when you&#39;re looking at some code in a year, thinking: &amp;quot;Who wrote this shit?! It&#39;s a mess!&amp;quot;, and then figure out it was you.&lt;/p&gt;
&lt;p&gt;Now, is there anything essential I&#39;m missing, that you want to add?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">IE8 and Doctype switching</title>
            <link href="http://friendlybit.com/css/ie8-and-doctype-switching/" rel="alternate" type="text/html" title="IE8 and Doctype switching" />
            <published>2008-01-26T17:44:50+01:00</published>
            <updated>2008-01-26T17:44:50+01:00</updated>
            <id>http://friendlybit.com/css/ie8-and-doctype-switching/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">The topic of this week has been IE8s new rendering mode, and the strange way to trigger it. As usual, I&#39;ve decided not to comment right away, and instead...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/ie8-and-doctype-switching/">
                &lt;p&gt;The topic of this week has been IE8s new rendering mode, and the strange way to trigger it. As usual, I&#39;ve decided not to comment right away, and instead first read what others are saying and try to form an opinion.&lt;/p&gt;
&lt;p&gt;I believe the best articles that talks about the switch are these:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&#34;http://www.b-list.org/weblog/2008/jan/23/legacy/&#34;&gt;Legacy&lt;/a&gt;, by &lt;span class=&#34;person-name&#34;&gt;James Bennet, puts this move in a bigger context. I believe his most important conclusion is that Microsoft are now clearly positioning themselves towards big old corporate intranets, reiterating &amp;quot;Don&#39;t break the web&amp;quot;.&lt;br /&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.andybudd.com/archives/2008/01/has_internet_ex/&#34;&gt;Has Internet Explorer Just Shot Itself in the Foot?,&lt;/a&gt; by Andy Budd, talks about how Microsoft marginalizes their own browser. Most people won&#39;t know about the switch, and end up in IE7 mode, so there&#39;s no real need for anyone to upgrade. IE7s rendering engine needs to be with us, forever.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://diveintomark.org/archives/2008/01/23/microsoft-koan&#34;&gt;Microsoft koan&lt;/a&gt;, by Mark Pilgrim, elegantly points out that strange code (unknown doctypes, including html5) will be rendered in standards mode, and ordinary code (proper doctype) will be rendered in IE7 mode. Seems twisted?&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;the-real-strangeness&#34;&gt;The real strangeness&lt;a href=&#34;#the-real-strangeness&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;What I can&#39;t understand in all of this is how IE7-specific sites can be such big of a problem. Because that what all of this fuss is really about. That&#39;s why we need a new switching mode and they need to ship the IE7 rendering engine with IE8.&lt;/p&gt;
&lt;p&gt;So, now there&#39;s a couple of different sites.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;IE6 specific sites.&lt;/strong&gt; My guess is that these are the majority of sites out there. These will break as much in IE8 as they did in IE7. &amp;quot;Don&#39;t break the web&amp;quot; does not apply to these sites.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IE7 specific sites&lt;/strong&gt;. These are much fewer and got updated rather recently (badly, to work only in IE7). The new switch is there for these sites. With the switch these sites won&#39;t break.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sites built to the standards&lt;/strong&gt;. These were also updated rather recently, but unlike the above sites they were built to the standards. Fixes for IE6 and IE7 were properly only sent to just those browsers, and will &lt;em&gt;not&lt;/em&gt; be sent to IE8 (conditional comments anyone?). If you targeted IE7 with your conditional comment, IE8 will not get that fix, breaking these type of sites. Well, unless IE8 will execute IE7 conditional comments, when that engine does the rendering.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So let&#39;s look back at the previous articles, keeping in mind the IE team mantra: &amp;quot;&lt;em&gt;Don&#39;t break the web&lt;/em&gt;&amp;quot;, the very reason why this fix exists.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First article&lt;/strong&gt; (1): My guess is that many corporate intranets belong in the first group of sites. They haven&#39;t been updated in a while, and won&#39;t be either. This group of sites will be just as unhappy with IE8 as they were with IE7. This can&#39;t be about those sites. IE team mantra: &amp;quot;&lt;em&gt;Keep breaking the web just as much as we broke it before&lt;/em&gt;&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Second article&lt;/strong&gt; (2): This switch will increase the number of sites in the IE7 specific group. This will be at the expense of the standards group. When a developer not knowing about the switch sees that his site works in IE7 and IE8 (which will be the same), he will stop working on it. IE team mantra: &amp;quot;&lt;em&gt;Freeze the web to IE7&lt;/em&gt;&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Third article&lt;/strong&gt; (3): Since unknown doctypes will send IE8 into standards mode, there will be even more breakage than before. What? Well, sites with broken doctypes, that previously sent IE6 and IE7 into quirks mode and relied on that, will break. IE Team mantra: &amp;quot;&lt;em&gt;Break the web&lt;/em&gt;&amp;quot;.&lt;/p&gt;
&lt;p&gt;Additionally, modern developers that don&#39;t read the IE blog, and don&#39;t know about the new switch, will keep getting IE7s strange behaviour on their sites. And since the switch also can be made via a HTTP header, even copying the full HTML and CSS of a site might break it when looking at it locally. IE team mantra: &amp;quot;&lt;em&gt;Make people read our blog, or go insane trying to develop to the standards&lt;/em&gt;&amp;quot;.&lt;/p&gt;
&lt;h2 id=&#34;what-it-all-comes-down-to&#34;&gt;What it all comes down to&lt;a href=&#34;#what-it-all-comes-down-to&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This is a terrible idea, both technically and in how it was presented. If the same idea had been presented in a more open manner, &amp;quot;&lt;em&gt;we&#39;re thinking about solving this problem like this… what do you think?&lt;/em&gt;&amp;quot;, people would have been much more willing to help, and had probably came up with a better solution.&lt;/p&gt;
&lt;p&gt;WaSP really acted badly by not first talking to the community, or at least discussing things internally, and instead just presented how IE8 will be built. Also, since this won&#39;t help developing standards based websites, and instead help IE7 specific sites, I&#39;m not sure what the WaSP has to do with this issue whatsoever.&lt;/p&gt;
&lt;p&gt;On the constructive side of things, I think the &lt;strong&gt;best way forward for IE8 is to change the switch to be opt-in, letting IE7 specific sites switch to IE7 rendering if they want to&lt;/strong&gt;. That&#39;s makes sure IE7 sites that break are easy to fix, and does not break havoc on the rest of the web. Don&#39;t set the default to worse rendering than you can produce.&lt;/p&gt;
&lt;p&gt;With the above change, I&#39;m looking forward to another modern web browser, IE8.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Sharepoint 2007 from an interface developer’s view</title>
            <link href="http://friendlybit.com/css/sharepoint-2007-from-an-interface-developers-view/" rel="alternate" type="text/html" title="Sharepoint 2007 from an interface developer’s view" />
            <published>2008-01-20T12:10:42+01:00</published>
            <updated>2008-01-20T12:10:42+01:00</updated>
            <id>http://friendlybit.com/css/sharepoint-2007-from-an-interface-developers-view/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Like Cameron Moll (Skinning Sharepoint and Pointedly unskinnable), I&#39;ve been working with Sharepoint 2007 (aka MOSS) recently, and I hope you don&#39;t mind me...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/sharepoint-2007-from-an-interface-developers-view/">
                &lt;p&gt;Like Cameron Moll (&lt;a href=&#34;http://cameronmoll.com/archives/2007/05/skinning_ms_sharepoint_with_st/&#34;&gt;Skinning Sharepoint&lt;/a&gt; and &lt;a href=&#34;http://cameronmoll.com/archives/2007/10/sharepoint_2007_pointedly_unskinnable/&#34;&gt;Pointedly unskinnable&lt;/a&gt;), I&#39;ve been working with Sharepoint 2007 (aka MOSS) recently, and I hope you don&#39;t mind me posting a few articles about my work here. I&#39;ve found far too few blog posts that really go to the depth in explaining how things really work. I&#39;ll try to do that here, but I hope you can respect my wish that this does not turn into a helpdesk.&lt;/p&gt;
&lt;h2 id=&#34;quotcustomizationquot&#34;&gt;&amp;quot;Customization&amp;quot;&lt;a href=&#34;#quotcustomizationquot&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let&#39;s start. &lt;strong&gt;Sharepoint 2007 very, very hard to customize&lt;/strong&gt;. If your job is to customize the interface in any major way, you have a lot of work ahead of you. You might think you&#39;re a much better interface developer than me, but you still have a lot of work ahead of you. You need to accept that.&lt;/p&gt;
&lt;p&gt;When you read about Sharepoint 2007 on other sites you will find that people are really ecstatic about it. Just check the comments on how to &lt;a href=&#34;http://planetwilson.blogspot.com/2007/09/sharepoint-2007-colour-color-calendar.html&#34;&gt;customize the calendar&lt;/a&gt;. Reading carefully you will find that he&#39;s comparing it with Sharepoint 2003, not with other products, or even a standard ASP.NET site. That&#39;s a big difference. Sharepoint 2003 was much worse, but that does not mean things are good now. This is a common pattern, people that like Sharepoint compare it to the previous version, not with better ways of doing things.&lt;/p&gt;
&lt;p&gt;As most CMS:es, Sharepoint gets sold to customers that don&#39;t know programming. They see a product that can handle all the features they want: blogs, wikis, forums, calendars, document libraries, workflows, and so on. All features you could ever want is included, from what is called &amp;quot;out of the box&amp;quot;. The problem is that the system is built so that all of those &amp;quot;out of the box&amp;quot; features are hard to customize. Things like changing how the wiki renders, is really hard. Often it&#39;s easier to rebuild that feature from scratch, than customizing what Sharepoint ships.&lt;/p&gt;
&lt;p&gt;This is the main reason, from my point of view, that you should pick another CMS.&lt;/p&gt;
&lt;h2 id=&#34;specifics&#34;&gt;Specifics&lt;a href=&#34;#specifics&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I don&#39;t believe you trust me on my words, so I thought I&#39;d be more specific now, and talk about the issues that make Sharepoint 2007 hard to work with (customize). Let me stress that these are not all the issues, just the major ones that an interface developer has to tackle.&lt;/p&gt;
&lt;h3 id=&#34;development&#34;&gt;Development&lt;a href=&#34;#development&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;From what I&#39;ve read from larger projects, the recommended development environment for a Sharepoint site is a virtual machine. For us, we needed a 36 Gb image, a size that required me to get a new external hard drive, just to store it. Also, running in a virtual machine means that you only can use about half of your RAM, which means everything gets slow. As if that wasn&#39;t enough, a new virtual machine means you have to reinstall all your programs, browsers, plugins again. Web development shouldn&#39;t have to be like that.&lt;/p&gt;
&lt;h3 id=&#34;accessibility&#34;&gt;Accessibility&lt;a href=&#34;#accessibility&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Sharepoint has gotten a lot of bashing for not being accessible, so they&#39;ve added some features to account for that. Some of those are really good individually, but looking at the general mess that is the HTML that Sharepoint spits out, the pretty page above fades in importance. One major problem is that you still need &lt;strong&gt;javascript enabled&lt;/strong&gt; for many of the accessibility features. Enabling &amp;quot;Accessibility mode&amp;quot;, among other things, makes dropdown menus appear as new windows (popups) instead of dynamically writing HTML to the page. And this is after they &amp;quot;fixed&amp;quot; it.&lt;/p&gt;
&lt;h3 id=&#34;page-size&#34;&gt;Page size&lt;a href=&#34;#page-size&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A standard Sharepoint site uses lots of default Javascript and CSS in two files called core.js and core.css. All in all they add up to over 250 kb. Yes, that&#39;s not a misspelling or extra zero, a default page in sharepoint takes at least 250 kb. This is not counting the HTML, a huge, table-ridden, inline-javascripted, mess of things.&lt;/p&gt;
&lt;p&gt;If you go through lots of trouble, you can strip those files out, but that means you can&#39;t use any default components. Since much of Sharepoint depend on those, you don&#39;t really want to go that way. It&#39;s a mess, and Microsoft themselves recommend you try to &lt;a href=&#34;http://msdn2.microsoft.com/en-us/library/bb727371.aspx#MOSS2007OptPerfWCM_PagePayloadSmallisGood&#34;&gt;remove some of it&lt;/a&gt; to boost performance. Preferably by using AJAX to load the js file later. Seriously.&lt;/p&gt;
&lt;h3 id=&#34;javascript-and-browser-dependencies&#34;&gt;Javascript and Browser dependencies&lt;a href=&#34;#javascript-and-browser-dependencies&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Except from core.js, the javascript is spread out all over the place. As usual in many CMS:es, javascript is not treated as a real programming language, so there&#39;s no structuring whatsoever. Sometimes it&#39;s script tags, sometimes inline, sometimes external mini files, and most often automatically generated code. It&#39;s a real mess, and is a big reason for the HTML size being so large. Many of the scripts do not work in browsers other than IE, which means you really need IE to properly use the admin interface.&lt;/p&gt;
&lt;p&gt;From the browser compatability info you can read that there are level 1 and level 2 browsers:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;Level 2 web browsers support all of our basic functionality so that users can both read and write in our content sites, perform site administration, etc. Some functionality may not be available, some functionality may be available in a more limited form, and some visual rendering may not be as optimized as our Level 1 browsers. We also will not support Level 2 web browsers on the Central Administration site.&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;These are the Level 2 browsers: Firefox, Netscape, Safari. Opera isn&#39;t even in the list. Is this the new, modern way, of handling cross browser compatibility?&lt;/p&gt;
&lt;h3 id=&#34;changing-the-css&#34;&gt;Changing the CSS&lt;a href=&#34;#changing-the-css&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;I previously said that most CSS is included in a file called core.css. The file in itself if huge, with thousands of class names, and no structuring whatsoever. Heather Solomon has made an attempt to make things workable by &lt;a href=&#34;http://www.heathersolomon.com/content/sp07cssreference.htm&#34;&gt;making images of what each class specifies&lt;/a&gt;. It&#39;s not even nearly a complete reference, and helps some, but using &lt;a href=&#34;http://getfirebug.com/&#34;&gt;Firebug&lt;/a&gt; is a faster way. Another thing the CSS sheet above does, is show how completely unorganized the CSS is. Have a look at it.&lt;/p&gt;
&lt;p&gt;As with core.js you can&#39;t really remove core.css, since lots of built-in functionality depends on it. So what you need to do is start deciding which of those rules you need to overwrite and which not. Have fun!&lt;/p&gt;
&lt;p&gt;To add to the insult, if you just add your own CSS as an external file and try to link to that on your own pages, core.css is appended as the last stylesheet in the source code. This of course means that all your changes get overwritten, and you need to hack around things by using the &lt;link&gt; tag directly (instead of sharepoint&#39;s own csslink-control), or add your custom files via the admin interface. Since core.css is just a list of simple class names, you can also use &lt;a href=&#34;http://www.htmldog.com/guides/cssadvanced/specificity/&#34;&gt;CSS Specificity&lt;/a&gt; to make your rules count, but that isn&#39;t mentioned in any of the troubleshooting blog posts. None the less, it&#39;s tedious do work around.&lt;/p&gt;
&lt;h3 id=&#34;share-point-and-master-pages&#34;&gt;Share point and Master pages&lt;a href=&#34;#share-point-and-master-pages&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Most of Sharepoint is upgraded to use .NET 2.0, and its concept of Master pages and aspx pages. For those of you that don&#39;t develop in .NET the two can be explained as a templating mechanism, where each Master page has general placeholders where you can insert aspx pages. In each aspx page you specify one master page, and all of the placeholders you want to fill with content. It&#39;s a pretty good system.&lt;/p&gt;
&lt;p&gt;Sharepoint taps into this system by making up two strings &amp;quot;~masterurl/custom.master&amp;quot;, and &amp;quot;~masterurl/default.master&amp;quot;, that you use instead of specifying your own masterpages. Users then specify masterpages in the admin interface, potentially breaking the entire site. Also, Sharepoint assumes there&#39;s just one masterpage per site, so if you thought you could use one masterpage for twocolumn layouts, and another for threecolumn layouts, you&#39;re wrong. The solution here is to break out of the Sharepoint way and hardcode real urls instead of doing things the Sharepoint way.&lt;/p&gt;
&lt;p&gt;There&#39;s also things you can&#39;t change. The admin interface has a masterpage called application.master, which controls pretty much everything that has to do with built-in Sharepoint things. You don&#39;t ever change this file, since it&#39;s quite easy to seriously break things then. The problem is that this file also specify the look and feel of the admin interface, and if you&#39;re building a site where people are expected to add stuff, they will spend time in the admin interface. There isn&#39;t a good way around this, and you probably end up just changing some colors via CSS and let it be.&lt;/p&gt;
&lt;h3 id=&#34;default-net-controls&#34;&gt;Default .NET controls&lt;a href=&#34;#default-net-controls&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The default master pages that ship with Sharepoint is horrendous and I&#39;ll post more details about them in a later post. But even if you roll your own master pages from scratch you still have the standard .NET-problem with controls. Using controls in .NET is a way to package functionality that you can easily add to your pages. A developer just needs to copy a DLL file, and call the control, optionally sending in some parameters. Easy.&lt;/p&gt;
&lt;p&gt;The problem with this approach is that a control consists both of logic and HTML. So if you want some built-in logic that renders, say, the breadcrumb trail, you also get the HTML the author of the control deemed appropriate. In Sharepoint, a breadcrumb trail can be a doubly nested table, with display: none; controls to enable accessibility, and a doubly span nested link. It&#39;s just a terrible mess, but there&#39;s no other way to get to the breadcrumb logic, except from building a new control from scratch. Be prepared to work with terrible HTML.&lt;/p&gt;
&lt;h2 id=&#34;in-summary&#34;&gt;In summary&lt;a href=&#34;#in-summary&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;If you want to examine the points above by yourself, there&#39;s a MOSS example site up at &lt;a href=&#34;http://www.wssdemo.com/default.aspx&#34;&gt;wssdemo.com&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This article is a interface developer view at Sharepoint 2007. If you look at the system from other viewpoints, I&#39;m sure there are good things there. That&#39;s not my point. What I&#39;m trying to say is that &lt;strong&gt;Sharepoint 2007, is beyond repair when it comes to interface customization&lt;/strong&gt;, and you should do everything in your power to avoid working with it. If I can give one interface developer the arguments to convince a customer to pick another system, this article was worth it. Thanks for reading.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">IE8 renders the acid 2 test</title>
            <link href="http://friendlybit.com/css/ie8-renders-the-acid-2-test/" rel="alternate" type="text/html" title="IE8 renders the acid 2 test" />
            <published>2007-12-20T00:27:21+01:00</published>
            <updated>2007-12-20T00:27:21+01:00</updated>
            <id>http://friendlybit.com/css/ie8-renders-the-acid-2-test/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">I&#39;m not sure why I don&#39;t see that many people talking about the fact that IE8 renders the acid 2 test perfectly now. It really seems Microsoft is starting...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/ie8-renders-the-acid-2-test/">
                &lt;p&gt;I&#39;m not sure why I don&#39;t see that many people talking about the fact that &lt;a href=&#34;http://blogs.msdn.com/ie/archive/2007/12/19/internet-explorer-8-and-acid2-a-milestone.aspx&#34;&gt;IE8 renders the acid 2 test perfectly&lt;/a&gt; now. It really seems Microsoft is starting to move forward again, after starting to feel some pressure from the open source world. Will they be able to pick up the speed needed to get 96% marketshare again? Time will tell.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Good &lt;a href=&#34;http://channel9.msdn.com/showpost.aspx?postid=367207&#34;&gt;interview about IE8&lt;/a&gt; on channel9.&lt;/p&gt;
&lt;/blockquote&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Future of web standards (my take)</title>
            <link href="http://friendlybit.com/css/future-of-web-standards-my-take/" rel="alternate" type="text/html" title="Future of web standards (my take)" />
            <published>2007-12-20T00:35:18+01:00</published>
            <updated>2007-12-20T00:35:18+01:00</updated>
            <id>http://friendlybit.com/css/future-of-web-standards-my-take/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Stuart Landridge sums up the ongoing debate about the future of CSS. My thoughts on this are that we should: Let browser makers run loose with implementing...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/future-of-web-standards-my-take/">
                &lt;p&gt;Stuart Landridge sums up the &lt;a href=&#34;http://www.kryogenix.org/days/2007/12/17/reigniting-the-browser-wars&#34;&gt;ongoing debate about the future of CSS&lt;/a&gt;. My thoughts on this are that we should:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Let browser makers run loose with implementing &lt;strong&gt;new features&lt;/strong&gt;, based on feedback from web developers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have a standard body (or some other group) that look at those &lt;strong&gt;existing features&lt;/strong&gt; and see how they can be standardized.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have browsers change their implementation of the &lt;strong&gt;features to match&lt;/strong&gt; what the standards body proclaims.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt; stops the bad idea that is to have a committee of people do innovation work. You need people both that know what web developers want and what is possible to implement. Browser makers do this.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt; makes sure the wild features that browser makers have played with get usable on real sites. To be usable a certain feature needs to be usable across (a majority of) browsers, and web developers of today know this. Before reaching this stage features will be played with, but not used on production sites.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;. Browser makers having implemented a feature differently from what the spec suggests need to change their implementation to match that of the standard. This step means that the standards body need to have the trust of the browser makers.&lt;/p&gt;
&lt;p&gt;For the features of a certain browser, this means that a feature will move from &amp;quot;experimental&amp;quot;, when it&#39;s played with, and to &amp;quot;standardized&amp;quot;, when there is a spec and the feature conforms to it. Browsers need to specify this somehow.&lt;/p&gt;
&lt;p&gt;I believe this is a much saner process than what is going on right now. Let&#39;s try it.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">CSS3 Media queries instead of the media attribute</title>
            <link href="http://friendlybit.com/css/css3-media-queries-instead-of-the-media-attribute/" rel="alternate" type="text/html" title="CSS3 Media queries instead of the media attribute" />
            <published>2007-11-21T18:21:50+01:00</published>
            <updated>2007-11-21T18:21:50+01:00</updated>
            <id>http://friendlybit.com/css/css3-media-queries-instead-of-the-media-attribute/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">In my previous post about the media attribute I talked about how strange the media attribute is, and that its usefulness isn&#39;t that obvious. As a followup I...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/css3-media-queries-instead-of-the-media-attribute/">
                &lt;p&gt;In my previous post about the media attribute I talked about &lt;a href=&#34;/css/media-attribute/&#34;&gt;how strange the media attribute is&lt;/a&gt;, and that its usefulness isn&#39;t that obvious.&lt;/p&gt;
&lt;p&gt;As a followup I want to point you to an article that Russell Beattie wrote about &lt;a href=&#34;http://www.russellbeattie.com/blog/css3-and-the-death-of-handheld-stylesheets&#34;&gt;CSS3 media queries&lt;/a&gt;. Media queries are a way to &lt;strong&gt;check the capabilities&lt;/strong&gt; of a user-agent instead of checking what kind of media type it claims to be. This makes a lot of sense to me. Does it really matter if someone is using a small computer screen or a big mobile phone? What about if they use a &lt;a href=&#34;http://www.youtube.com/watch?v=CZrr7AZ9nCY&#34;&gt;big ass table&lt;/a&gt;? (aside from the pun, I really think &lt;a href=&#34;http://www.youtube.com/watch?v=rP5y7yp06n0&#34;&gt;Microsoft surface&lt;/a&gt; is cool)&lt;/p&gt;
&lt;p&gt;Checking for capabilities of a certain user-agent makes much more sense: &amp;quot;if available width larger than 200px, show two columns instead of one&amp;quot;. If they are dynamically evaluated (I don&#39;t know if they are), they allow you to build truly dynamic layouts, that work virtually everywhere. That&#39;s what I call accessible layouts.&lt;/p&gt;
&lt;p&gt;An interesting parallel is comparing checking user-agent strings and &lt;a href=&#34;http://developer.apple.com/internet/webcontent/objectdetection.html&#34;&gt;object detection in javascript&lt;/a&gt;, and the media attribute and media queries. I believe media queries is the natural next step. Today, the different types of media have started to mix; just look at TV:s and computers, or handheld computers and mobile phones. &lt;strong&gt;The type of media is not as important, capabilities are&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Although queries do not solve all of the questions I put forward in the previous post, they do pose an interesting alternative. Agreed?&lt;/p&gt;
&lt;p&gt;(&lt;a href=&#34;http://www.w3.org/TR/css3-mediaqueries/&#34;&gt;CSS3 Media queries&lt;/a&gt; are as a standard currently a candidate recommendation (which means it&#39;s safe to implement), and is currently &lt;a href=&#34;http://www.css3.info/preview/media-queries/&#34;&gt;supported by Opera 9 and Safari 3&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Opera 9.5 evaluates the queries dynamically, Safari does not, thanks &lt;a href=&#34;http://simon.html5.org/&#34;&gt;zcorpan&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Media attribute – what have you done for me lately?</title>
            <link href="http://friendlybit.com/css/media-attribute/" rel="alternate" type="text/html" title="Media attribute – what have you done for me lately?" />
            <published>2007-10-29T00:06:54+01:00</published>
            <updated>2007-10-29T00:06:54+01:00</updated>
            <id>http://friendlybit.com/css/media-attribute/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">I&#39;ve been thinking for a while about the media attribute on link tags. Some people might find that thinking deep thoughts about HTML attributes is kind of...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/media-attribute/">
                &lt;p&gt;I&#39;ve been thinking for a while about the media attribute on link tags. Some people might find that thinking deep thoughts about HTML attributes is kind of strange, but I know you, my dear readers, know the feeling ;)&lt;/p&gt;
&lt;p&gt;An example, just so I know we&#39;re on the same page:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;link&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;style.css&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;media&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;handheld&amp;quot;&lt;/span&gt;
   &lt;span class=&#34;na&#34;&gt;rel&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This makes sure devices that support the handheld media type (mobile phones?) should load that stylesheet, but no others. It seems simple doesn&#39;t it? By using a simple attribute you can style things differently for certain devices. But there&#39;s several things to keep in mind, that actually make this attribute a lot less useful.&lt;/p&gt;
&lt;h2 id=&#34;problem-number-1-presentation-and-content-are-cou&#34;&gt;Problem number 1: Presentation and content are coupled&lt;a href=&#34;#problem-number-1-presentation-and-content-are-cou&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;One of the big selling points of CSS is the separation of presentation from content. And while I believe that&#39;s still a good thing to have, not everyone agrees about it&#39;s usefulness. Some time ago Jeff Croft wrote an article about how unusual it is to only change the CSS and not the HTML of a site. While he&#39;s mostly making a point of why we should use a certain CSS framework, there&#39;s a good point hidden there: Right now it isn&#39;t possible to separate things completely.&lt;/p&gt;
&lt;p&gt;Designers have of course known this for centuries. They will tell you: you need to adapt the design to the content you&#39;re designing. If you&#39;re building a site for a shampoo, you might use water and bubbles in your design. If you build a web development blog, you use an image of blueish sky… ehm… Well, you get the point. Good design adapts to the content. They are coupled.&lt;/p&gt;
&lt;p&gt;You can&#39;t just switch out the content and expect the design to still work. Sure, you can make small adjustments, and make these available as alternate stylesheets, but larger changes just doesn&#39;t work. The problem with the media attribute is that it&#39;s made for big design changes (switching media), but with no changes in content. How often can you just restyle a word document to get a powerpoint slide? What about converting that slide to something nicely viewable on a mobile phone? That&#39;s what the media attribute is there for.&lt;/p&gt;
&lt;p&gt;My point is: switching to another media needs much more than just a change in design. You need to change the content to fit that media too. And if you change the content, why not change what stylesheet you link to? This is why I rarely use the &amp;quot;handheld&amp;quot; or &amp;quot;projection&amp;quot; values.&lt;/p&gt;
&lt;h2 id=&#34;problem-number-2-load-time&#34;&gt;Problem number 2: Load time&lt;a href=&#34;#problem-number-2-load-time&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You could think that the browser only loads the one stylesheet that matches the media it&#39;s currently showing. Not true. All stylesheets, &lt;a href=&#34;http://www.phpied.com/delay-loading-your-print-css/&#34;&gt;no matter what media&lt;/a&gt; they are tied to, are loaded at startup.&lt;/p&gt;
&lt;p&gt;This means that the more media types you account for, the longer the load time for any of them will be. Very annoying.&lt;/p&gt;
&lt;h2 id=&#34;problem-number-3-user-agent-support&#34;&gt;Problem number 3: User agent support&lt;a href=&#34;#problem-number-3-user-agent-support&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;While being able to design for specific user agents might sound like a good idea, the media attribute still requires user agents to support it. If a large part of user agents refuse to apply your style using the media attribute, why not use another method directly? Just to get an idea of how messy support currently is, you can read the &lt;a href=&#34;http://css-discuss.incutio.com/?page=HandheldStylesheets&#34;&gt;css-discuss summary of the handheld problems&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;Some current phones apply &amp;quot;screen&amp;quot; styles as well as &amp;quot;handheld&amp;quot; styles, others ignore both, and in some cases the phone carrier runs pages through a proxy that strips styles out even if the phone could recognize them, so it&#39;s a crapshoot figuring out what will get applied&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As you see, the value of the media attribute isn&#39;t entirely obvious. Sure, you might be able to use it for print with good results, but that&#39;s not all it&#39;s there for. Right?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">@media Ajax London, here I come</title>
            <link href="http://friendlybit.com/css/media-ajax-london-here-i-come/" rel="alternate" type="text/html" title="@media Ajax London, here I come" />
            <published>2007-10-28T23:09:37+01:00</published>
            <updated>2007-10-28T23:09:37+01:00</updated>
            <id>http://friendlybit.com/css/media-ajax-london-here-i-come/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Just a short note that I&#39;ll be attending @media Ajax London, 19th-20th November. If you see me, come by and say hello!</summary>
            <content type="html" xml:base="http://friendlybit.com/css/media-ajax-london-here-i-come/">
                &lt;p&gt;Just a short note that I&#39;ll be attending &lt;a href=&#34;http://www.vivabit.com/atmediaajax/&#34;&gt;@media Ajax London&lt;/a&gt;, 19th-20th November. If you see me, come by and say hello!&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">I’m an interface developer</title>
            <link href="http://friendlybit.com/css/im-an-interface-developer/" rel="alternate" type="text/html" title="I’m an interface developer" />
            <published>2007-08-20T23:17:55+02:00</published>
            <updated>2007-08-20T23:17:55+02:00</updated>
            <id>http://friendlybit.com/css/im-an-interface-developer/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">In his latest post Roger Johansson asks the question Are we designers or developers?. I have a simple answer for that. None of them. Let me explain: First...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/im-an-interface-developer/">
                &lt;p&gt;In his latest post Roger Johansson asks the question &lt;a href=&#34;http://www.456bereastreet.com/archive/200708/are_we_designers_or_developers/&#34;&gt;Are we designers or developers?&lt;/a&gt;. I have a simple answer for that. &lt;strong&gt;None of them&lt;/strong&gt;. Let me explain:&lt;/p&gt;
&lt;p&gt;First we have these people calling themselves &lt;strong&gt;developers&lt;/strong&gt;. And boy do they know programming… and math… and… no that&#39;s all. Many have a masters degree in computer science, a degree that pretty much tells you that they once gave five years of their lives to programing, how cool is that!? It&#39;s not unusual to find people that &lt;a href=&#34;http://xkcd.com/55/&#34;&gt;think in those terms&lt;/a&gt; too. You can recognize them by their 10 year old, unmatched, clothes and you&#39;ll rarely talk more than 1 minute with them. Very efficient.&lt;/p&gt;
&lt;p&gt;Then we have the &lt;strong&gt;designers&lt;/strong&gt;. Either real females, or people very close to females, that just can&#39;t stop talking about this abstract thingie-thongie that just like, you know, exploded in a big burst of colors and like… &amp;quot;EHEM! Sorry!&amp;quot;, you hear them say, regaining consciousness and flying back to earth. Their clothes, at least you think they are clothes, often look like they where meant for something else. Perhaps for building steel pumps, or killing animals… or both. Well, at least these clothes are matched… or very purposefully not at all matched (not at aaaall like the developers). You can talk with these people for hours, probably even days, and still only touch upon the delicate topic of &amp;quot;a glass of water&amp;quot;. Oh, and they &amp;quot;create&amp;quot; things too. Very deep.&lt;/p&gt;
&lt;p&gt;So where the heck does the &lt;strong&gt;interface developer&lt;/strong&gt; come into all of this? Well, imagine you have a real project at hand. Real people that need some new website to do their work. Real deadlines, money that switches hands. Smiling business people that promises things and shake hands. Seems like something you know of?&lt;/p&gt;
&lt;p&gt;Now, imagine bringing a developer and a designer together in a room, for like a month, working together with this new website. Concentrate hard and try to see the images before your very eyes. Will they accomplish anything?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Hell no!&lt;/strong&gt; In 5 minutes they will have started arguing about who should be the first one to open the door, and in what way. One talking about the most efficient way to turn the handle, and the other one defending herself by talking about cosmic beams from Saturn. After the first day the developer will have sore cheeks, after being constantly bitch slapped while hiding under his desk. The third day the designer will sit shaking in a corner after the electric shock induced by the steel helmet the developer built. None of them will survive the fourth day, let alone the project.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Very yes!&lt;/strong&gt; When you meet them after the month has passed you find two harmonic people that smiles to each other and really seem to have connected. They explain to you that the demonstration will be in two parts, first the designer and then the programmer. The designer shows you an app that really touches you, at least you think so, although you not fully understand it. The programmer shows you the other part of the app, one that instantly shows the number 369. They finish the presentation and look at you. You stand up, walk out, lock yourself into a nearby free conference room, and shout with all the power in your lungs: &amp;quot;HOW THE F*#CK AM I GOING TO DO MY TAXES WITH THIS SHIT?!#&amp;quot;. When you come back you find them congratulating each other for making the deadline.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You see? There&#39;s something missing there. Some kind of link between the two. Someone that can walk into a room with two screaming people and calmly say: &amp;quot;Hey, you both kinda run linux (SuSE vs. Mac OS X), and have a &amp;quot;cold&amp;quot; desktop background (default plain blue vs. modern interpretation of &lt;a href=&#34;http://en.wikipedia.org/wiki/Image:Vasnetsov_Snegurochka.jpg&#34;&gt;Vasnetsov Snegurochka&lt;/a&gt;), what a coincidence!?&amp;quot;. There needs to be someone that can walk into the same room the next day and explain that they are talking about two different kinds of &amp;quot;abstract methods&amp;quot;. There needs to be a link.&lt;/p&gt;
&lt;p&gt;But there&#39;s more: An interface developer is silly enough to learn languages that doesn&#39;t even have variables. Even though he know that his code will be sent as uncompressed plaintext and will be rendered by broken excuses for programs, he won&#39;t cry himself to bed every night.&lt;/p&gt;
&lt;p&gt;He will also gladly adapt a design to something it wasn&#39;t really intended for, and he even will make it look somewhat good. He will skip adding those fabulous shadows, to make the deadline on time, and still think of himself a good person.&lt;/p&gt;
&lt;p&gt;You see, even though &amp;quot;interface&amp;quot; reflect the visual graphic things, and &amp;quot;developer&amp;quot; relate to hard logic code, &lt;strong&gt;interface developers&lt;/strong&gt; are real people, not a combination of two halves. I am one.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Min-width and Max-width template</title>
            <link href="http://friendlybit.com/css/min-width-and-max-width-template/" rel="alternate" type="text/html" title="Min-width and Max-width template" />
            <published>2007-05-28T20:57:31+02:00</published>
            <updated>2007-05-28T20:57:31+02:00</updated>
            <id>http://friendlybit.com/css/min-width-and-max-width-template/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Some problems seem to appear again and again, and one of them is page width. How wide should a site be? Should you adapt to 800px resolution? 1024px? Fully...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/min-width-and-max-width-template/">
                &lt;p&gt;Some problems seem to appear again and again, and one of them is &lt;strong&gt;page width&lt;/strong&gt;. How wide should a site be? Should you adapt to 800px resolution? 1024px? Fully fluid with percentages? Perhaps elastic using em-units? There are lots to choose from. What I&#39;ve found is that there&#39;s one solution that almost always works. You most probably already know it, but I thought it might be helpful for some to have a template you just copy and use.&lt;/p&gt;
&lt;p&gt;The idea is to use a fluid width but limit it by using &lt;code&gt;min-width&lt;/code&gt; and &lt;code&gt;max-width&lt;/code&gt;. As with almost all CSS tricks, we do a little bit of hacking for Internet Explorer 6 (IE6). Link to the working &lt;a href=&#34;/files/min-max-template/&#34; data-no-instant&gt;min/max template&lt;/a&gt; is available, and an explanation follows.&lt;/p&gt;
&lt;p&gt;I&#39;m picking 760px as the minimum width. It fits within a maximized browser window on 800×600 resolution, accounting for scrollbars. Next we need some kind of max-width, and for this I&#39;m going to pick 960px. I could probably go a bit higher but 960 is nicely divisible with a lot of numbers, 3, 4, 5, 6, 8, 10, 12, 15, and 16, making for nice columns (see &lt;a href=&#34;http://cameronmoll.com/archives/2006/12/gridding_the_960/&#34;&gt;Gridding the 960&lt;/a&gt;). Lastly we need some way to tell the browser to follow the width of the browser window when resizing, and width: 100% does that.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;wrapper&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;min-width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;760&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;max-width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;960&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This assumes that you have a div with id wrapper around all your content.&lt;/p&gt;
&lt;p&gt;The above works perfectly in both Firefox, IE7, Opera, and Safari. But (as usual) there&#39;s one culprit: IE6. To solve this I&#39;m going to use the fact that IE allows for javascript execution inside CSS files. Have a look at the code below:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;wrapper&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;960&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;expression&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;documentElement&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;clientWidth&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;962&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;?&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;960px&amp;quot;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;documentElement&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;clientWidth&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;762&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;?&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;760px&amp;quot;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;            &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;auto&amp;quot;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;First, the element gets a width by means of a IE expression(). The expression looks at the window width and if it&#39;s too wide it sets it to 960. It also limits it downwards to 760 pixels. At last we need to set trigger hasLayout on the element, and I usually use height: 1% for that (zoom: 1 works aswell).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Martin suggests we add a default width when IE have javascript turned off. Excellent, added it to the example. The default width will be applied in IE if javascript is turned off.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Matthjis notes that there is a &lt;a href=&#34;http://www.cameronmoll.com/archives/000892.html&#34;&gt;bug in IE6&lt;/a&gt; that causes it to freeze sometimes when using the same number for the conditional as for the max or min-value. Updated the code to reflect this.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;(The expression is built up with two tertiary operators, so &lt;code&gt;(condition)? &amp;quot;true value&amp;quot;: &amp;quot;false value&amp;quot;;&lt;/code&gt;, with a couple of numbers in it. Check it, it makes sense.)&lt;/p&gt;
&lt;p&gt;The IE6-stuff above will of course not validate (and doesn&#39;t work in other browsers), so what we do is enclose it inside a conditional comment. The final &lt;a href=&#34;/files/min-max-template/&#34; data-no-instant&gt;min-/max-width example&lt;/a&gt; has all the code you need (I&#39;ve added centering too), but you should of course move the code to an external file.&lt;/p&gt;
&lt;p&gt;Happy hacking!&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Reverse text with CSS (32 very special hex digits)</title>
            <link href="http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/" rel="alternate" type="text/html" title="Reverse text with CSS (32 very special hex digits)" />
            <published>2007-05-06T18:13:32+02:00</published>
            <updated>2007-05-06T18:13:32+02:00</updated>
            <id>http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Sometimes you wake up and feel that big things are moving around you. You follow the news and find that people are uniting over something simple as a...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/reverse-text-with-css-32-very-special-hex-digits/">
                &lt;p&gt;Sometimes you wake up and feel that &lt;a href=&#34;http://yro.slashdot.org/article.pl?sid=07/05/02/0235228&#34;&gt;big things&lt;/a&gt; are moving around you. You follow the news and find that people are uniting over something simple as a number. You read about people &lt;a href=&#34;http://technology.timesonline.co.uk/tol/news/tech_and_web/article1749672.ece&#34;&gt;calling them rebels&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I think this is a good time to show a little CSS trick.&lt;/p&gt;
&lt;p&gt;Let me present two properties that together reverse a string of text: direction and unicode-bidi:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;direction: rtl; unicode-bidi: bidi-override;&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
0C 88 65 36 5C 65 14 8D B5 3E 47 D9 20 11 9F 90
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The result, when this is posted on your blog (*hint*) is the following:&lt;/p&gt;
&lt;code style=&#34;direction: rtl; unicode-bidi: bidi-override;&#34;&gt;
0C 88 65 36 5C 65 14 8D B5 3E 47 D9 20 11 9F 90&lt;/code&gt;

&lt;p&gt;Am I a CSS rebel now? And are they going to sue me on the basis of my HTML or my CSS?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Transparent PNGs and IE6 standalone</title>
            <link href="http://friendlybit.com/css/transparent-pngs-and-ie6-standalone/" rel="alternate" type="text/html" title="Transparent PNGs and IE6 standalone" />
            <published>2007-04-28T20:44:31+02:00</published>
            <updated>2007-04-28T20:44:31+02:00</updated>
            <id>http://friendlybit.com/css/transparent-pngs-and-ie6-standalone/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">I&#39;m one of many that have installed IE6 standalone and it really is a great solution to running both IE6 and IE7 on the same computer. Frequently people...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/transparent-pngs-and-ie6-standalone/">
                &lt;p&gt;I&#39;m one of many that have installed &lt;a href=&#34;http://tredosoft.com/Multiple_IE&#34;&gt;IE6 standalone&lt;/a&gt; and it really is a great solution to running both IE6 and IE7 on the same computer. Frequently people claim that IE6 standalone and the real IE6 render things differently but I&#39;ve never seen that happen. Until now.&lt;/p&gt;
&lt;h2 id=&#34;why-an-alpha-transparent-image&#34;&gt;Why an alpha transparent image?&lt;a href=&#34;#why-an-alpha-transparent-image&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I&#39;m working on a site with several alpha-transparent areas, where authors should be able to switch images and an semi-transparent box should cover half of that image. The users are not skilled enough with image programs to be able to add the transparent part to the image, and adding it to the image would prevent it from expanding when the containing text was zoomed. So I decided to use CSS together with alpha transparent PNGs to solve it. Let’s get to business.&lt;/p&gt;
&lt;h2 id=&#34;alpha-transparency-on-modern-browsers&#34;&gt;Alpha transparency on modern browsers&lt;a href=&#34;#alpha-transparency-on-modern-browsers&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Fireworks, my favourite image editor, allowed me to set the opacity to 60%. It smoothly exported my image to PNG and I positioned everything where it should be. Two background images later, one that the author could specify (added with a style tag in the head, &lt;a href=&#34;/css/inline-css-should-not-be-allowed-in-strict-doctypes/&#34;&gt;not with inline styles&lt;/a&gt;), and one with the transparency. Everything worked flawlessly in Firefox, Opera, and IE7, as expected. Easy!&lt;/p&gt;
&lt;h2 id=&#34;ie6-and-alphaimageloader&#34;&gt;IE6 and AlphaImageLoader&lt;a href=&#34;#ie6-and-alphaimageloader&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;IE6 does not support PNG images like that, so I decided to use what I always use to fix that, the &lt;a href=&#34;http://support.microsoft.com/kb/294714&#34;&gt;AlphaImageLoader Filter&lt;/a&gt;. Note that the fix doesn&#39;t make the background specified with CSS work, it &lt;em&gt;adds a new&lt;/em&gt; element to the page, on top of the element you apply it to. It&#39;s also proprietary, meaning it won&#39;t validate, so make sure add it to the page by using &lt;a href=&#34;http://www.quirksmode.org/css/condcom.html&#34;&gt;conditional comments&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One thing you need to know to use the filter is how the &lt;a href=&#34;http://msdn2.microsoft.com/en-us/library/ms532920.aspx&#34;&gt;sizingMethod property&lt;/a&gt; works:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;crop&lt;/strong&gt; - Clips the image to fit the dimensions of the object.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;image&lt;/strong&gt; - Default. Enlarges or reduces the border of the object to fit the dimensions of the image.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;scale&lt;/strong&gt; - Stretches or shrinks the image to fill the borders of the object.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So there is no way to repeat an image as we&#39;re used to from CSS. Luckily, since I wanted a solid semi-transparent background repeating and scaling is the same, so I just did:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;breadcrumbs&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;progid&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;DXImageTransform&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Microsoft&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;AlphaImageLoader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;semi_transparent.png&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sizingMethod&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;scale&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;making-links-work-in-ie6&#34;&gt;Making links work in IE6&lt;a href=&#34;#making-links-work-in-ie6&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You could think that we&#39;ve hacked enough to get things up to speed with IE6, but no. Links on top of images loaded with filter does not work. The text of them are selectable, but you can&#39;t click them. Fortunately Ingo Chao fixed this in 2005 (some people are WAY ahead) by simply &lt;a href=&#34;http://www.satzansatz.de/cssd/tmp/alphatransparency.html&#34;&gt;adding an inner wrapper&lt;/a&gt; with hasLayout enabled. Thanks Ingo!&lt;/p&gt;
&lt;p&gt;Everything set, and tested in Firefox, Opera, IE7 and IE6 standalone. Phew!&lt;/p&gt;
&lt;h2 id=&#34;differences-between-ie6-standalone-and-ie6&#34;&gt;Differences between IE6 standalone and IE6&lt;a href=&#34;#differences-between-ie6-standalone-and-ie6&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;After deploying the design on the client&#39;s server I quickly got a bug report back: &amp;quot;The breadcrumbs have a grey background, not a transparent one&amp;quot;. I double checked the client&#39;s browser version to be IE6, and tested again locally on my own computer: it worked for me but not for the client. Confused I started looking for another computer with IE6 on (something that was surprisingly hard) I found one at the reception. Gotcha, the PNG was broken there too. I confirmed that IE7 was not installed and downgraded my own to IE6 again. Let&#39;s get to work!&lt;/p&gt;
&lt;p&gt;After much fiddling with CSS I moved over to Fireworks again. It has three different versions of PNGs you can export as: PNG-8, PNG-24, and PNG32. I tried &lt;strong&gt;switching from PNG-24 to PNG-8&lt;/strong&gt; and *blam* it worked!&lt;/p&gt;
&lt;p&gt;I&#39;m not sure why this works, but after reading the comments on the &lt;a href=&#34;http://tredosoft.com/Multiple_IE&#34;&gt;Multiple IE&lt;/a&gt; page, I have a guess. To get filters to work in IE6 standalone two files are added to the IE6 folder. The authors picked them from an updated version of IE6; could it be that Microsoft updated the filters somewhere between my downgraded version and the latest IE6? After Googling I found an update to IE6 called SP1 which changes the behaviour of alphaimageloader. Quite likely, and very tricky to find.&lt;/p&gt;
&lt;p&gt;Anyway, I hope this long story taught you something, I sure did it for me: Next time I&#39;ll use &lt;a href=&#34;http://www.twinhelix.com/css/iepngfix/&#34;&gt;Iepngfix.htc&lt;/a&gt; instead :)&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">IE7 Zoom Bug: Text width incorrectly calculated</title>
            <link href="http://friendlybit.com/css/ie7-zoom-bug/" rel="alternate" type="text/html" title="IE7 Zoom Bug: Text width incorrectly calculated" />
            <published>2007-04-28T17:44:03+02:00</published>
            <updated>2007-04-28T17:44:03+02:00</updated>
            <id>http://friendlybit.com/css/ie7-zoom-bug/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">IE7 shipped with a new and improved Page Zoom feature that lets you zoom more than just the text of the page. While I think I like it (there&#39;s many saying...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/ie7-zoom-bug/">
                &lt;p&gt;IE7 shipped with a new and improved Page Zoom feature that lets you zoom more than just the text of the page. While I think I like it (there&#39;s many saying it will make developers lives easier), it has its bugs.&lt;/p&gt;
&lt;p&gt;The most recent one I&#39;ve seen is its failure to &lt;a href=&#34;/files/ie7_zoom_bug/&#34; data-no-instant&gt;correctly calculate text width&lt;/a&gt;. I&#39;ve found no fix for this, except adding a right-margin, something that renders the box too wide instead of too narrow. The calculation seems to a little bit better with &lt;code&gt;font-style: italic;&lt;/code&gt;, but it&#39;s still incorrect.&lt;/p&gt;
&lt;p&gt;It you have a fix, let me know in the &lt;a href=&#34;#comments&#34;&gt;comments&lt;/a&gt; (the usual stuff does not seem to work).&lt;/p&gt;
&lt;p&gt;I guess the Page Zoom is hard to implement, since basic things like that breaks. At the other hand, Opera has had it for years, and Firefox will in version 3. I really look forward to explaining this to customers :)&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Separation in the blink of an eye</title>
            <link href="http://friendlybit.com/css/separation-in-the-blink-of-an-eye/" rel="alternate" type="text/html" title="Separation in the blink of an eye" />
            <published>2007-01-23T10:10:11+01:00</published>
            <updated>2007-01-23T10:10:11+01:00</updated>
            <id>http://friendlybit.com/css/separation-in-the-blink-of-an-eye/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">I&#39;ve seen them so many times: pages where the HTML is mighty fine (!) but the CSS looks like it&#39;s taken straight from Dreamweaver. While I hate having to...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/separation-in-the-blink-of-an-eye/">
                &lt;p&gt;I&#39;ve seen them so many times: pages where the HTML is mighty fine (!) but the CSS looks like it&#39;s taken straight from Dreamweaver. While I hate having to deal with those kinds of designs there is something good about them. They prove the point that HTML and CSS are two separate units, and that it&#39;s possible to mess up one of them and do fine on the other. That&#39;s after all the point of CSS…&lt;/p&gt;
&lt;p&gt;Now. A much more unusual combination is good CSS together with bad HTML. So I put together a little example for you. &lt;a href=&#34;/files/separation_illustrated/&#34; data-no-instant&gt;Separation illustrated&lt;/a&gt; (only works in Firefox, I&#39;m lazy). I&#39;ve made all lines about 80 characters long and removed all other whitespace. Enjoy!&lt;/p&gt;
&lt;p&gt;How&#39;s that for a company website?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Dear Justin Timberlake…</title>
            <link href="http://friendlybit.com/css/dear-justin-timberlake/" rel="alternate" type="text/html" title="Dear Justin Timberlake…" />
            <published>2006-12-12T12:10:24+01:00</published>
            <updated>2006-12-12T12:10:24+01:00</updated>
            <id>http://friendlybit.com/css/dear-justin-timberlake/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">You really are my big hero. When you swing your hips and slide over the floor so the ladies at the front row faint, I know I should have gone for superstar...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/dear-justin-timberlake/">
                &lt;p&gt;&lt;img src=&#34;https://www.billboard.com/files/styles/article_main_image/public/media/justin-timberlake-vma-650d_0.jpg&#34; alt=&#34;Justin Timberlake with scarf&#34; class=&#34;secondary&#34; /&gt;&lt;/p&gt;
&lt;p&gt;You really are my big hero. When you swing your hips and slide over the floor so the ladies at the front row faint, I know I should have gone for superstar instead of web developer.&lt;/p&gt;
&lt;p&gt;That Michael Jackson dance-alike thing you&#39;ve got going really works; just look at your huge fan base, all eager to be like you. Paparazzi follow every step you make, eager to tell the world about all the little things you&#39;re up to.&lt;/p&gt;
&lt;p&gt;This is why it surprises me that your website (&lt;a href=&#34;http://www.justintimberlake.com&#34;&gt;justintimberlake.com&lt;/a&gt;) is using technology from 1996. How would it look if you walked around promoted something like the &lt;a href=&#34;http://www.topspotz.com/blog/mullet.jpg&#34;&gt;mullet haircut&lt;/a&gt;?! Having a website like yours is just like that, you&#39;re promoting a technological mullet!&lt;/p&gt;
&lt;p&gt;What&#39;s even worse, some of your fans are following suit and use the same ideas for their fan sites, with technology that blocks access for many users, that prevent search engines for finding them, and that adds extra work for them when updating.&lt;/p&gt;
&lt;p&gt;So, how do we solve this problem of yours? Well, there&#39;s many options available. Let me tell you about my favorite:&lt;/p&gt;
&lt;p&gt;Start by sneaking out of your fancy house. Make sure you avoid as many paparazzi as possible, but the idea is not to shake them all off. I&#39;m sure you&#39;re much more skilled in these areas than I am. Now, meet me somewhere with a computer that has an internet connection. You probably want to send me a plane ticket: I&#39;m guessing Stockholm, Sweden is a bit too far away from you.&lt;/p&gt;
&lt;p&gt;Anyway, the idea is that I will teach you what I know about web development right there. You get a free course from a famous blogger (oh well, semi-famous in small parts of Sweden). The languages used are not hard to learn, don&#39;t worry about that, they are designed to be easy. You&#39;re a smart guy, so I&#39;m sure it will go smooth. After the first day you will know all about structuring your site, after a week you&#39;ll be able to reconstruct your current site with modern technology. After that there&#39;s no limit.&lt;/p&gt;
&lt;p&gt;When you&#39;ve mastered web development we&#39;ll add a final twist. Accidentally, we&#39;ll reveal what you&#39;ve been up to for the few paparazzi that are still following you. The headlines will be huge: &amp;quot;Justin Timberlake learns secret web arts&amp;quot; and &amp;quot;New way to grow your fan base: Justin explains&amp;quot;. It will be great, and the media will go crazy! So, what do you think? Send me an e-mail at &lt;a href=&#34;mailto:emil@emilstenstrom.se&#34;&gt;emil@emilstenstrom.se&lt;/a&gt; if you&#39;re interested.&lt;/p&gt;
&lt;p&gt;Or, you could just hire someone good (ask for web standards and accessibility)… But what fun would that be?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Sorry Justin, I&#39;m not gay, this is just about web development ;)&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">IE6 bug: Ignored selector hover bug</title>
            <link href="http://friendlybit.com/css/ie6-bug-ignored-selector-hover-bug/" rel="alternate" type="text/html" title="IE6 bug: Ignored selector hover bug" />
            <published>2006-11-27T22:04:42+01:00</published>
            <updated>2006-11-27T22:04:42+01:00</updated>
            <id>http://friendlybit.com/css/ie6-bug-ignored-selector-hover-bug/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">IE6 bugs seem to pop up all over the place recently. This one is a very small one, but it might affect people that are building tabbed navigation or...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/ie6-bug-ignored-selector-hover-bug/">
                &lt;p&gt;IE6 bugs seem to pop up all over the place recently. This one is a very small one, but it might affect people that are building tabbed navigation or CSS-based tooltips. The problem is that IE6 ignores selectors in the form of &lt;code&gt;a:hover [selector]&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;a href=&#34;#the-problem&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Say you want to build a tabbed navigation where tabs move slightly when you hover them (that was how I found the bug). Since you want to reuse the images for the tabs you divide them into two pieces (according to &lt;a href=&#34;http://alistapart.com/articles/slidingdoors/&#34;&gt;sliding doors&lt;/a&gt;). But to do that you need two elements that react on hover. One can be the link but you need one more. So you add a nested span and your code looks like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;url1&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;span&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Home&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;span&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;url2&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;span&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Contact&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;span&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;url3&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;span&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;About&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;span&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You cleverly position the span and the link, and add a couple of rules to your stylesheet. You also want the text to move slightly, just like the background, so you add some padding.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nd&#34;&gt;hover&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sx&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;no-repeat&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;top&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;span&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;display&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;block&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nd&#34;&gt;hover&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;span&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sx&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;no-repeat&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;top&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;padding-top&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You look at the site in Firefox, Opera, Safari, and IE7 and everything works just fine. But what&#39;s that? Why doesn&#39;t the text move in IE6? You start removing CSS and HTML to pinpoint the problem and end up with a &lt;a href=&#34;/files/ie6hoverpadding/&#34; data-no-instant&gt;very small testcase with the bug intact&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;a href=&#34;#the-solution&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Looking at the testcase I was just confused. I was pretty sure I&#39;d seen IE6 do selectors like that before, but why didn&#39;t it work now? &lt;a href=&#34;http://www.satzansatz.de/cssd/onhavinglayout.html&#34;&gt;HasLayout&lt;/a&gt; and the other usual IE6 fixes didn&#39;t work.&lt;/p&gt;
&lt;p&gt;I loaded up my IM client and started asking people if they knew anything. &lt;a href=&#34;http://simon.html5.org&#34;&gt;Simon&lt;/a&gt; noted that everything started working when you changed the selector to &lt;span class=&#34;... &#34;&gt;&lt;code&gt;a:hover, a:hover span&lt;/code&gt;&lt;/span&gt;. Ok, so setting and then resetting that rule seemed to work. Some further experimenting revealed that just setting &lt;strong&gt;any&lt;/strong&gt; padding to a:hover (setting it to zero worked well) also solved the problem.&lt;/p&gt;
&lt;p&gt;That was good enough, an extra &lt;span class=&#34;padding-top: 0 &#34;&gt;&lt;code&gt;a:hover&lt;/code&gt;&lt;/span&gt;. So here&#39;s the &lt;a href=&#34;/files/ie6hoverpadding/fixed.html&#34; data-no-instant&gt;testcase with the bug solved&lt;/a&gt;. The bug is apparently fixed in IE7.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">How to structure large CSS files</title>
            <link href="http://friendlybit.com/css/how-to-structure-large-css-files/" rel="alternate" type="text/html" title="How to structure large CSS files" />
            <published>2006-11-21T21:55:47+01:00</published>
            <updated>2006-11-21T21:55:47+01:00</updated>
            <id>http://friendlybit.com/css/how-to-structure-large-css-files/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Many methods exist to structure your CSS. This article tries to describe the method I use. I call it the &#34;Tree method&#34;, since it structures the CSS like…...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/how-to-structure-large-css-files/">
                &lt;p&gt;Many methods exist to structure your CSS. This article tries to describe the method I use. I call it the &amp;quot;Tree method&amp;quot;, since it structures the CSS like… that&#39;s right, a tree structure. I want to stress that it isn’t my invention; I just describe and give reasons for its rules.&lt;/p&gt;
&lt;p&gt;Everyone that has built a bigger site has had to deal with the mess CSS so easily become. There are ids and classes all over the place, and to find where a certain class is defined you usually need to use some search feature in your editor. Matching the other way, from the CSS to the HTML is even harder; you don&#39;t even know &lt;em&gt;what file&lt;/em&gt; a certain class is defined in. It’s a mess.&lt;/p&gt;
&lt;p&gt;The Tree method tries to structure the CSS into logical blocks; blocks taken from the HTML. It also aims to be easy to understand for anyone. No secret codes or difficult ordering schemes.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#order&#34;&gt;Order your selectors like the HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#full&#34;&gt;Always use the &amp;quot;full path&amp;quot; to elements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#indent&#34;&gt;Indent your code cleverly&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#own&#34;&gt;Each declaration on its own line&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#alpha&#34;&gt;… in alphabetic order&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;order&#34;&gt;Order your selectors like the HTML&lt;a href=&#34;#order&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;One of the problems of mapping between the HTML and the CSS is that they usually differ in structure. The HTML is (if you’re lucky) structured like a convenient semantical tree while the CSS often is ordered by something random like fonts, colors, and positioning.&lt;/p&gt;
&lt;p&gt;To make moving between the two worlds easier we want to make them as similar as possible. Is the HTML divided into header, content, and footer? Then make sure that&#39;s the three major parts of your CSS as well. Have you put the navigation above your header in the HTML? Then order it like that in the CSS as well! Any other structure makes moving from the HTML to the CSS much harder. You might be able to find all font manipulations in one part of the CSS, but only if you know that this particular developer uses that exact scheme. No, let’s keep it simple.&lt;/p&gt;
&lt;p&gt;Here&#39;s a simple example where we just order the selectors:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;strong&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When grouping several styles into one definition I just put the group above both of their specific styles. &lt;code&gt;#header, #content&lt;/code&gt; comes before both #header and #content.&lt;/p&gt;
&lt;h2 id=&#34;full&#34;&gt;Always use the &amp;quot;full path&amp;quot; to elements&lt;a href=&#34;#full&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The above is very easy to get an overview of, but the experienced developer knows that very few sites are that easy. Something you often want is a way to define different styles to different parts of a page. Let’s say you want green links in the navigation, but want to keep them blue everywhere else.&lt;/p&gt;
&lt;p&gt;For this we use sub selectors. The selector &lt;code&gt;#navigation a&lt;/code&gt; lets you give all links inside your navigation another look. But let’s take that further. Why not always write the &lt;em&gt;full path&lt;/em&gt; to your elements? Why not use &lt;code&gt;#navigation ul li a&lt;/code&gt; instead? Doing this gives a developer looking at your code a lot of information about how the HTML and CSS belongs together.&lt;/p&gt;
&lt;p&gt;Lets add that to the previous example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;strong&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This does change the meaning from before. Before we selected all the level two headers; now we only select headers inside of the header division. Extending each selector with a &amp;quot;path&amp;quot; has made our CSS rules more specific, and specific means more control for you.&lt;/p&gt;
&lt;p&gt;This also makes for fewer new ids and classes; just specify the path to an element instead of adding a class for it. Don&#39;t add a new class or id unless you really need to.&lt;/p&gt;
&lt;p&gt;We still have the issue of &amp;quot;common styles&amp;quot;; styles that we want to apply to elements in different parts of the tree. Since they should be applied to all elements they don’t fit in the tree structure we&#39;ve built. Instead we make a section in the beginning of the file (or a separate) with just &amp;quot;general styles&amp;quot;. Don&#39;t add rules to this section if you only use them once in the document, you want as much of your code to be in &amp;quot;the tree&amp;quot; as possible.&lt;/p&gt;
&lt;h2 id=&#34;indent&#34;&gt;Indent your code cleverly&lt;a href=&#34;#indent&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To make the code even easier to understand I always add indentation (for those that don&#39;t know that word: it means spacing in front of blocks of text). Indenting makes the tree structure we&#39;re trying to build even clearer, you can easily find the major sections and dig down from there.&lt;/p&gt;
&lt;p&gt;Lets add indention to you our example too:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;strong&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Don&#39;t take indentation too far. If you&#39;re styling tables and using thead in the markup, but don&#39;t change the style of it, you can skip that indentation level. Double indention just for the sake of it is just a waste of space.&lt;/p&gt;
&lt;h2 id=&#34;special-case-templating&#34;&gt;Special case: Templating&lt;a href=&#34;#special-case-templating&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We also need to deal with rules that only appear on some of our pages. Perhaps we want the home page to look somewhat different than the sub pages? We solve this by giving an id or class to the body element. Doing this lets me specify styles for just one specific page, and setting the id or class on body makes me able to change anything in the document based on that.&lt;/p&gt;
&lt;p&gt;These page specific styles need a place in the tree too. Here I tend to break from the above scheme and put them together with the style they change. So &lt;code&gt;body#page_home #header h1&lt;/code&gt; is one step below &lt;code&gt;#header h1&lt;/code&gt; in the tree. That makes it easier to see all styles for a certain element, instead of scrolling back and fourth (like you need to do if you don&#39;t remember your general styles). Keep your templates together with the style they change instead of completely separate.&lt;/p&gt;
&lt;p&gt;If you want bigger changes, perhaps a totally different look on some pages, there&#39;s no reason to group things according to the scheme above. Move them to a separate file instead.&lt;/p&gt;
&lt;h2 id=&#34;own&#34;&gt;Each declaration on its own line&lt;a href=&#34;#own&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Indentation combined with full paths makes some lines rather long. This means that putting all declarations on one line will force you to scroll horizontally, something we already avoid on our sites. The simplest way to prevent horizontal scrolling is to use one declaration per line, so that&#39;s what the tree method uses.&lt;/p&gt;
&lt;h2 id=&#34;alpha&#34;&gt;… in alphabetic order&lt;a href=&#34;#alpha&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Grouping of properties is another issue. I&#39;ve seen grouping schemes based on all sorts of things; from splitting things into &amp;quot;positioning&amp;quot;, colors, and fonts, to people adding their properties completely randomly. I&#39;ve chosen to just order them alphabetically. It&#39;s one of the few methods that bring some order while still being simple enough. I&#39;ve seen total beginners do this by themselves; something I believe is a good argument for it. It&#39;s intuitive.&lt;/p&gt;
&lt;p&gt;A simple example to illustrate:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Blue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;3.4&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Arial&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;sans-serif&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;margin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0.5&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;One complaint I&#39;ve heard on this method is that it splits up things that belong together. People tend to keep &lt;code&gt;position: absolute&lt;/code&gt; and &lt;code&gt;left: 0&lt;/code&gt; together, just to name one such pairing. It annoyed me at first too, but declaration blocks rarely contain more than 10 declarations, and the alphabetic order still makes them easy to find. Also, why handle position different than float and margin?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;That&#39;s it! By following a few simple rules you can get a CSS-file that&#39;s easier to overview, a file that you proudly can give away to the next developer. I can praise its existence all day, but you&#39;re the judge of whether it works or not. Why not give it a try in your next project?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Maurice van Creij writes in and says that he&#39;s using the same method. A good way to get started is to generate a CSS file from the HTML. He has written a javascript that does just that. Nice! Try generating a CSS file.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Another part structuring your CSS is making sure you don&#39;t load too much. I wrote an article previously about &lt;a href=&#34;/css/static-and-dynamic-css-combined/&#34;&gt;combining static and dynamic CSS&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: This article got digged to the frontpage. There&#39;s a lot of good comments there (but as usual pretty harsh language).&lt;/p&gt;
&lt;/blockquote&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Web development blogs you should read</title>
            <link href="http://friendlybit.com/css/web-development-blogs-you-should-read/" rel="alternate" type="text/html" title="Web development blogs you should read" />
            <published>2006-11-19T04:40:48+01:00</published>
            <updated>2006-11-19T04:40:48+01:00</updated>
            <id>http://friendlybit.com/css/web-development-blogs-you-should-read/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">The web is filled with blogs about web development. I&#39;m always looking for good blogs to add to my feed reader and I thought some of you might do that too....</summary>
            <content type="html" xml:base="http://friendlybit.com/css/web-development-blogs-you-should-read/">
                &lt;p&gt;The web is filled with blogs about web development. I&#39;m always looking for good blogs to add to my feed reader and I thought some of you might do that too. So let me list the webdev blogs I subscribe to right now (in alphabetic order):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.456bereastreet.com/&#34;&gt;456 Berea St&lt;/a&gt;&lt;/strong&gt; - Roger Johansson is one of the most well known web developers out there, and it&#39;s for a reason. He posts almost daily about things happening in the webdev field. Everything from short comments with links to things to full blown articles.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://headrush.typepad.com/creating_passionate_users/&#34;&gt;Creating passionate users&lt;/a&gt;&lt;/strong&gt; - Simply one of the best blogs there is, all categories. Deals with usability and making users happy. The posts are everything from hilarious to spectacular and I often get the motivation to write from here. Read an article or just look at one of the wonderful graphs. You&#39;ll love it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.thefutureoftheweb.com/&#34;&gt;Future of the web&lt;/a&gt;&lt;/strong&gt; - Jesse Skinner writes for all skill levels. Articles vary from basic markup to advanced javascript tutorials. Often with a twist of humour added in the middle of an article. Nice read.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://mondaybynoon.com&#34;&gt;Monday By Noon&lt;/a&gt;&lt;/strong&gt; - Jon posts articles weekly (as reflected in the name) about all things related to web development. His friendly tone and ability to explain things makes this site ideal for people starting out. The good thing is that the same style works for more experienced people too. Try one of the articles, I&#39;m sure you&#39;ll like it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://f6design.com/journal/&#34;&gt;Pixel Acres&lt;/a&gt;&lt;/strong&gt; - Jonathan Nicol combines webdev articles with thoughts on how to deal with clients and co-workers. Well written and qualitative, what else do you need?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.robertnyman.com/&#34;&gt;Robert&#39;s talk&lt;/a&gt;&lt;/strong&gt; - Robert Nyman&#39;s blog, mixing personal posts with those that have to do with all kinds of interfaces. Entertaining read that feels balanced and well thought-out.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://rundkvadrat.com/&#34;&gt;Rund kvadrat&lt;/a&gt;&lt;/strong&gt; - Blog in Swedish about making money on the web. While this isn&#39;t the primary concern for many interface developers we should certainly keep it in mind. Does moving a certain link upwards increase the client&#39;s sales?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Well, and then there&#39;s all the big ones, but they tend to post too much about the conferences they attended and the books they wrote. Also, all their good articles end up on the big webdev news sites, which I also subscribe to.&lt;/p&gt;
&lt;p&gt;Do you have any other sites that should be on that list?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">IE6 bug: Encode and ignore</title>
            <link href="http://friendlybit.com/css/ie6-bug-encode-and-ignore/" rel="alternate" type="text/html" title="IE6 bug: Encode and ignore" />
            <published>2006-10-11T21:12:01+02:00</published>
            <updated>2006-10-11T21:12:01+02:00</updated>
            <id>http://friendlybit.com/css/ie6-bug-encode-and-ignore/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">I&#39;ve previously talked about encodings and tried to explain how they work. This time I&#39;ll show you a bug in IE6 that is based on encoding problems. Because...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/ie6-bug-encode-and-ignore/">
                &lt;p&gt;I&#39;ve previously talked about &lt;a href=&#34;/other/character-encoding-basics&#34;&gt;encodings&lt;/a&gt; and tried to explain how they work. This time I&#39;ll show you a bug in IE6 that is based on encoding problems. Because if you don&#39;t watch out, IE6 might ignore whole rules in your stylesheet. If you want you can see the example right away: &lt;a href=&#34;/files/encode-ignore/&#34; data-no-instant&gt;Ignore encoding example&lt;/a&gt;. Open in in IE6 and compare with the rendering in a modern browser.&lt;/p&gt;
&lt;p&gt;I&#39;ve never seen this bug mentioned before so I took the liberty of naming it the &lt;strong&gt;&amp;quot;Encode and Ignore bug&amp;quot;&lt;/strong&gt;. If you find it somewhere else, please tell, and I&#39;ll use that name instead.&lt;/p&gt;
&lt;p&gt;Now. Stylesheets unfortunately have no way of specifying encoding. So you type away in your favourite text editor set to some obfuscate Greek charset and of course expect everything to work. It often does. CSS works with very few characters; mostly you just use the letters A-Z, some brackets, and colons. Since most charsets have those positioned similarly there&#39;s no problem. But there are exceptions where you want to use other letters too: inside comments and in the future: in generated content.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: &lt;a href=&#34;http://rakaz.nl/&#34;&gt;Niels Leenheer&lt;/a&gt; points out that there are two ways to specify encoding on stylesheets. Either using the method in the &lt;a href=&#34;/other/character-encoding-basics&#34;&gt;encodings article&lt;/a&gt; to send a proper HTTP header, or using the @charset &amp;quot;utf-8&amp;quot;; rule. The latter is just a rule you put on the first line of the CSS. Even seems to have decent browser support. Thanks Niels!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So this Swedish friend of mine is learning CSS and I&#39;m helping him out when he notices a strange error. When setting his html document to be encoded in utf-8 IE6 starts to display the page differently. I had never seen anything like it and start digging through the code. After like half an hour I find the culprit: an &amp;quot;å&amp;quot;-letter in a comment!&lt;/p&gt;
&lt;p&gt;What he had done was add a comment after one of the colors he used, /* ljusblå */ (&amp;quot;light blue&amp;quot; in Swedish). When IE switches the HTML to UTF-8 the CSS seems to be switched with it. In UTF-8 mode the incorrectly encoded &amp;quot;å&amp;quot;-letter means something else, and IE not only ignores the comment or the line, but everything following it (still inside the current rule). So about half of a rule was ignored. I researched further and found that it was only triggered when the strange character was at the end of a comment.&lt;/p&gt;
&lt;p&gt;Interesting, and easy to miss. The solution is of course to encode your CSS in the same charset as your HTML, or if you&#39;re lazy put some characters after the culprit. A very simple (and kinda rare) problem, but I thought it might save you an hour of debugging sometime.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">How web standards feels</title>
            <link href="http://friendlybit.com/css/how-web-standards-feels/" rel="alternate" type="text/html" title="How web standards feels" />
            <published>2006-10-11T21:34:42+02:00</published>
            <updated>2006-10-11T21:34:42+02:00</updated>
            <id>http://friendlybit.com/css/how-web-standards-feels/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">When talking about web standards many of us have started using marketing terms. Every day we hear about the bandwidth savings, the increased user base that...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/how-web-standards-feels/">
                &lt;p&gt;When talking about web standards many of us have started using marketing terms. Every day we hear about the bandwidth savings, the increased user base that are able to access your site, how well it affects SEO and so on. But none of that was what got me into all this. Let me tell you about the thing that convinced me: the feeling.&lt;/p&gt;
&lt;p&gt;For me the web standards revolution started with a feeling that something was wrong. &amp;quot;There has got to be a better way&amp;quot;, was a thought that buzzed in my ears when nesting my tables to create some padding.&lt;/p&gt;
&lt;p&gt;I first saw CSS in other people&#39;s code, often embedded in style attributes with text-decoration: none; to remove underlines. I started experimenting, but the deeper aspects of how it could change the way websites were built didn&#39;t occur to me. It was just another tool to place things where I wanted them, and make things look like I wanted.&lt;/p&gt;
&lt;p&gt;At that time I didn&#39;t know any server-side language so all my sites where frame based static HTML, often with a fancy javascript enabled select box for navigation. I did use some CSS just to remove the underlinings on my links, but that was it. Something still felt wrong, was this really the best way?&lt;/p&gt;
&lt;p&gt;The &amp;quot;AHA!&amp;quot; feeling came much later; I&#39;d love to say a certain moment when I understood but it wasn&#39;t a certain text or piece of advice, it grew on me. Suddenly everything felt like it had its place. It wasn&#39;t always obvious where that place was, but you could reason your way there. When the strength of CSS occurred to me, it was like finally understanding a tough mathematical formula. Yes!&lt;/p&gt;
&lt;p&gt;So go ahead, show me your pretty charts of workday savings, &lt;a href=&#34;http://csszengarden.com/&#34;&gt;CSS Zen garden&lt;/a&gt; remakes, or new techniques you can use. I like them, I really do, but I&#39;m pretty convinced it&#39;s the &amp;quot;AHA!&amp;quot; feeling that finally wins people over to the web standards side.&lt;/p&gt;
&lt;p&gt;What won you over? Can you convince someone else using that method?&lt;/p&gt;
&lt;p&gt;(Inspiration from &lt;a href=&#34;http://headrush.typepad.com/creating_passionate_users/2006/09/motivating_othe.html&#34;&gt;Motivating others&lt;/a&gt;)&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Don’t use &#34;Divs for layout&#34; please</title>
            <link href="http://friendlybit.com/css/dont-use-divs-for-layout-please/" rel="alternate" type="text/html" title="Don’t use &#34;Divs for layout&#34; please" />
            <published>2006-09-11T22:07:23+02:00</published>
            <updated>2006-09-11T22:07:23+02:00</updated>
            <id>http://friendlybit.com/css/dont-use-divs-for-layout-please/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Proud people all over the world show their new sites and proudly proclaim: &#34;I used divs for layout!&#34; There&#39;s a problem with the above. Every time someone...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/dont-use-divs-for-layout-please/">
                &lt;p&gt;Proud people all over the world show their new sites and proudly proclaim: &amp;quot;I used divs for layout!&amp;quot;&lt;/p&gt;
&lt;p&gt;There&#39;s a problem with the above. Every time someone uses the phrase &amp;quot;Divs for layout&amp;quot; they spread the misconception that divs are some special kind of element. Beginners are tricked into thinking that everything you add to a page should be in a div. I&#39;ve seen great looking pages filled with; you guessed right, only divs.&lt;/p&gt;
&lt;p&gt;Some would say that these types of sites actually are worse than table sites. I don&#39;t agree. If you look at it in a wider perspective these people at least are on the right track. They are slowly learning and I as I&#39;ve tried to convey earlier I think it&#39;s ok to start out bad and gradually improve.&lt;/p&gt;
&lt;p&gt;So, why is it so bad using only divs? Because the idea of HTML is to convey structure. What structure does your content have? Are some parts more important than others? Are you using lists, but not the list element? Find the tags that best fit your particular purpose. There&#39;s &lt;a href=&#34;http://www.w3schools.com/tags/default.asp&#34; title=&#34;Elements available in HTML 4&#34;&gt;lots of elements&lt;/a&gt; out there. Any good front-end web developer should know (almost) all of them.&lt;/p&gt;
&lt;p&gt;Now, could we please stop using the phrase &amp;quot;Divs for layout&amp;quot;? If you want an alternative I would say &amp;quot;CSS for layout&amp;quot;. Spread the word my friends!&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">IE6 resize bug (position: relative becomes fixed)</title>
            <link href="http://friendlybit.com/css/ie6-resize-bug/" rel="alternate" type="text/html" title="IE6 resize bug (position: relative becomes fixed)" />
            <published>2006-09-04T22:08:49+02:00</published>
            <updated>2006-09-04T22:08:49+02:00</updated>
            <id>http://friendlybit.com/css/ie6-resize-bug/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">One bug kept popping up on the sites I built, and I was almost going insane. The bug I&#39;m talking about is specific to Internet Explorer 6 (IE6) and has to...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/ie6-resize-bug/">
                &lt;p&gt;One bug kept popping up on the sites I built, and I was almost going insane. The bug I&#39;m talking about is specific to Internet Explorer 6 (IE6) and has to do with what happens when you resize the page. Here&#39;s an &lt;a href=&#34;/files/ie6resizebug/&#34; data-no-instant&gt;example page showing the bug&lt;/a&gt;. Open it in IE6 and try resizing the window. Let me explain:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: &lt;a href=&#34;/css/ie6-resize-bug/#comment-4551&#34;&gt;Paula comments&lt;/a&gt; that IE7 beta 2 has the same problem. Thanks Paula.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&#34;setting-up-the-ie6-resize-bug&#34;&gt;Setting up the IE6 resize bug&lt;a href=&#34;#setting-up-the-ie6-resize-bug&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To see the bug in action you need two things: You need to center your page using the body element and you need to be using a fixed width (not percent) on the element. If you use this you will quickly notice that all elements you set &lt;code&gt;position: relative&lt;/code&gt; on, will stay fixed on the page when you resize the window. They behave as if you just set position: fixed on them, but only until you reload. It&#39;s really a fun effect (if you know the fix).&lt;/p&gt;
&lt;p&gt;Example code:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;margin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;auto&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;760&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;c&#34;&gt;/* Any fixed or fluid width */&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;/* Affects all elements with position: relative; */&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;position&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;relative&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here&#39;s a live example of the &lt;a href=&#34;/files/ie6resizebug/&#34; data-no-instant&gt;IE6 resize bug&lt;/a&gt; with borders added for clarity.&lt;/p&gt;
&lt;p&gt;The bug is kinda rare you could say. But using body for centering is a great way of getting rid of one extra container div, so I have been using it more and more lately (IE5 can&#39;t handle that, but you don&#39;t support it do you?). Anyway, not being able to use &lt;code&gt;position: relative&lt;/code&gt; is not ok.&lt;/p&gt;
&lt;h2 id=&#34;making-things-behave-as-normal-again&#34;&gt;Making things behave as normal again&lt;a href=&#34;#making-things-behave-as-normal-again&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Fortunately the fix is very easy. You simply add &lt;strong&gt;position: relative to the body element&lt;/strong&gt;. *Blam* All previous broken elements start behaving like expected again. Here&#39;s the same &lt;a href=&#34;/files/ie6resizebug/fixed.html&#34; data-no-instant&gt;example with the bug fixed&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;That&#39;s a couple of hours less IE6 adoption time on my next project. I hope it helps someone out there too.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">KTH goes web standards</title>
            <link href="http://friendlybit.com/css/kth-goes-web-standards/" rel="alternate" type="text/html" title="KTH goes web standards" />
            <published>2006-08-23T00:36:28+02:00</published>
            <updated>2006-08-23T00:36:28+02:00</updated>
            <id>http://friendlybit.com/css/kth-goes-web-standards/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Sweden&#39;s largest technological university, KTH, just launched their new site and I&#39;m proud to say that I&#39;ve been responsible for the HTML and CSS for it....</summary>
            <content type="html" xml:base="http://friendlybit.com/css/kth-goes-web-standards/">
                &lt;p&gt;Sweden&#39;s &lt;a href=&#34;http://www.kth.se&#34;&gt;largest technological university, KTH&lt;/a&gt;, just launched their new site and I&#39;m proud to say that I&#39;ve been responsible for the HTML and CSS for it. I&#39;d thought I&#39;d take some time and tell you about the techniques I used and the reasons behind using them. Let’s start with some background:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://www.kth.se&#34;&gt;&lt;img src=&#34;/images/item_kth.jpg&#34; alt=&#34;Blue KTH logotype&#34; class=&#34;secondary&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;about-kth&#34;&gt;About KTH&lt;a href=&#34;#about-kth&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;KTH is an initialism for &amp;quot;Kungliga tekniska högskolan&amp;quot; which translates to &amp;quot;Royal Institute of Technology&amp;quot; in English. It&#39;s the biggest technology focused university in Sweden with almost 17000 registered students for 04/05 (&lt;a href=&#34;http://www.scb.se/statistik/UF/UF0205/2005A02/Web_GR1_RegUnivKon.xls&#34; title=&#34;Number of registered students on KTH&#34;&gt;source&lt;/a&gt;). Add over 3000 employees to that and you&#39;ll start to see the number of people affected by the update. KTH hosts a lot of content, &lt;a href=&#34;http://www.google.com/search?hl=en&amp;amp;q=site%3Akth.se&#34;&gt;Google reports 1,930,000 pages&lt;/a&gt;. Not all pages are included in current the update, but it gives a pointer to what kind of site we are looking at. In summary, a standards based update of KTH affects a lot of people.&lt;/p&gt;
&lt;h2 id=&#34;polopoly-and-the-html&#34;&gt;Polopoly and the HTML&lt;a href=&#34;#polopoly-and-the-html&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I entered the project quite late in the process (&lt;a href=&#34;/css/valtech-my-new-employer/&#34;&gt;Valtech found me&lt;/a&gt;), about a month before launch. Most of the back-end work had already been completed and authors responsible for different parts of the organisation had started filling the database with content. The CMS used was a platform known as Cortina, based on top of the CMS framework &lt;a href=&#34;http://www.polopoly.com&#34;&gt;Polopoly&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Everything was modular and the changes I wanted to do to the HTML nicely cascaded out over the site. When you look at the HTML you&#39;ll notice that it contains a lot of strange whitespace, making the code somewhat difficult to read. That&#39;s because of the template language used, &lt;a href=&#34;http://java.sun.com/products/jsp/jstl/&#34;&gt;JSTL&lt;/a&gt;, which leaves whitespace after each element. I therefore recommend using the &lt;a href=&#34;http://users.skynet.be/mgueury/mozilla/&#34;&gt;HTML validator extension for Firefox&lt;/a&gt; , selecting view source, and then using the button &amp;quot;Clean up the page&amp;quot; in the bottom right corner. That makes the code a bit easier to read for you on the outside. I hope you won&#39;t be too upset over that :)&lt;/p&gt;
&lt;p&gt;You&#39;ll find that all new pages validates as HTML 4.01 Strict (or at least very close, I know of some ampersand encoding errors on one page) and I&#39;m very proud of the outputted HTML. It maps the structure of the content nicely and is easy to browse without CSS enabled. It contains very few elements that are there just as &amp;quot;style hooks&amp;quot; and the id and class names describes the contents of the elements, not their design.&lt;/p&gt;
&lt;h2 id=&#34;css-and-the-techniques-used&#34;&gt;CSS and the techniques used&lt;a href=&#34;#css-and-the-techniques-used&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The new site makes full use of CSS for its layout. We targeted mainly Firefox 1.5 and Internet Explorer 6 with the new site but using web standards I wouldn&#39;t be surprised if it works well in other modern browsers too. For those of you that like fancy terms I can say that the site is a fixed width, zoomable, source ordered, 3 column equal height layout. I&#39;ll talk a little about the fancy terms above and explain the reasoning behind them.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/images/item_ruler.jpg&#34; alt=&#34;Image of a Ruler&#34; class=&#34;secondary&#34; /&gt;&lt;/p&gt;
&lt;h3 id=&#34;fixed-width-layout&#34;&gt;Fixed width layout&lt;a href=&#34;#fixed-width-layout&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Let&#39;s start with the most controversial of the design decisions. The site is optimized for 1024×768 pixel resolutions and up. This was a hard decision but given the content of the site, the design at hand, and the target audience we felt that it was a good one. Let me explain our reasoning:&lt;/p&gt;
&lt;p&gt;KTH has a lot of information to display. Many different parts of the site need to get exposure and the wider 1024 format made that possible. Many of the images were also designed for the wide format and changing the width would mean we would have to examine all of them and decide how to cut each one. Surf around on the site and you&#39;ll see the problems that would bring. Objects in images, meant to be centered, would be offset and some items would be cut. Those content and design issues, together with the somewhat &amp;quot;technological&amp;quot; target audience, convinced us that 1024 was the right decision.&lt;/p&gt;
&lt;h3 id=&#34;zoomable-layout&#34;&gt;Zoomable layout&lt;a href=&#34;#zoomable-layout&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;We wanted to make the user able to change the font-size if they wanted to. This meant that quite a few boxes needed to expand with the text, to prevent the text from overflowing them. This was solved by selectively using em units making the boxes expand with the text-zoom. This worked well, and I&#39;m especially proud of the &lt;a href=&#34;http://www.kth.se&#34; title=&#34;KTH:s front-page&#34;&gt;front-page&lt;/a&gt;, with all the different elements expanding and collapsing together. There are a few glitches in the zoomed layouts, a couple of pixels missing here and there, but from the testing we have done those are few (there’s currently one line too much content in the middle box, making the zooming uneven, don’t worry about that :).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/images/item_order.jpg&#34; alt=&#34;List of groceries in order&#34; class=&#34;secondary&#34; /&gt;&lt;/p&gt;
&lt;h3 id=&#34;source-ordering-and-skip-links&#34;&gt;Source ordering and skip links&lt;a href=&#34;#source-ordering-and-skip-links&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The layout is a rather typical 3 column layout with a header and footer. The leftmost column is for navigation, the middle one for the real content, and the right one for additional information. In terms of importance the content is the most important, followed by the additional information column, followed by the navigation. This called for use of a technique known as source ordering, having the content in one order structurally and in another visually.&lt;/p&gt;
&lt;p&gt;Using source ordering is a good way of making it easier for non visual browsers (screen readers, text browsers, and search engines) to get the most important information first. This is not the right article to explain the method in full (some wrapper divs and some clever floats); I&#39;ll save that for a later article. Anyway, what matters is that there are some advantages to using this method and that we decided to use it.&lt;/p&gt;
&lt;p&gt;Others prefer to be able to jump to whatever place in the source they want. For this, &amp;quot;skip links&amp;quot; are quite effective. Skip links are internal links (links pointing to an id somewhere on the same page) that you put in the beginning of the HTML. Clicking the link moves the focus to the corresponding place in the content. We felt that this was a simple way to provide navigation for users with CSS disabled. The skip links where hidden for everyone else.&lt;/p&gt;
&lt;h3 id=&#34;3-column-equal-height&#34;&gt;3 column equal height&lt;a href=&#34;#3-column-equal-height&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;As many of the column layouts today this one was made with all columns of equal height. It&#39;s a common complaint amongst the &amp;quot;table for layout&amp;quot; users that these kinds of layouts are too hard to do with CSS. They are not. An easy technique for doing this is known as &lt;a href=&#34;/files/templates/?style=faux_columns&amp;cols=3&amp;nofooter=1&#34; data-no-instant&gt;faux columns&lt;/a&gt; and is simply: putting your columns in a wrapper, floating them left, and setting a background image in the wrapper. The wrapper expands whenever any of the columns expand and shows more of the tiled background image as needed. It&#39;s a simple technique, it works well, doesn’t contain any hacks, and is easy to learn. CSS vs. Tables: 1 - 0.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/images/item_matrixd.jpg&#34; alt=&#34;One of the 5 layouts available&#34; class=&#34;secondary&#34; /&gt;&lt;/p&gt;
&lt;h3 id=&#34;front-page-grid&#34;&gt;Front page grid&lt;a href=&#34;#front-page-grid&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;One of my favourite parts of the site is a feature that most users only will notice over time: The top left part of the front page can be switched between five different layouts, depending on what the editors feel fits their content best. This means that the editors are given a big chance to &amp;quot;design&amp;quot; the front page; a very nice move from the designer.&lt;/p&gt;
&lt;p&gt;For me, as the one responsible for implementing this, I had a couple of though days. But I learnt a lot and ended up using a min-height set with em units on the different boxes. This way I could make boxes at totally different parts of the page zoom together. IE6 handles height as min-height so setting &amp;quot;fixed&amp;quot; heights in a separate file for IE ensured that the design worked there too. After using and testing this method for a couple of weeks I must say that I like the it, it gives me a nice grid to work with, but not a fixed one as with tables. This one expands depending on what the content requires. I recommend you to try it out.&lt;/p&gt;
&lt;h3 id=&#34;conclusion&#34;&gt;Conclusion&lt;a href=&#34;#conclusion&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The developers behind the new KTH website have constructed a site that was incredibly fun to work with. I consider myself lucky to having worked with such a good team and have learnt a lot in the process.&lt;/p&gt;
&lt;p&gt;Also, as a student of KTH for many years I know that the site will be well received by fellow students; and at the end of the day, isn’t that what matters?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Valtech: my new employer</title>
            <link href="http://friendlybit.com/css/valtech-my-new-employer/" rel="alternate" type="text/html" title="Valtech: my new employer" />
            <published>2006-08-22T21:20:29+02:00</published>
            <updated>2006-08-22T21:20:29+02:00</updated>
            <id>http://friendlybit.com/css/valtech-my-new-employer/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Just wanted to let you know that I have accepted a job at Valtech. My title will be &#34;technical consultant&#34; (which could mean anything, I know :), and you...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/valtech-my-new-employer/">
                &lt;p&gt;Just wanted to let you know that I have accepted a job at &lt;a href=&#34;http://www.valtech.com&#34;&gt;Valtech&lt;/a&gt;. My title will be &amp;quot;technical consultant&amp;quot; (which could mean anything, I know :), and you have probably already guessed that I will be focusing on HTML and CSS; interface design in different forms. I started working last Thursday so today was my fourth day and I must say that I really like it there. A friendly atmosphere amongst (very) skilled developers is what I&#39;ve seen so far, and I know how much that counts when it comes great results.&lt;/p&gt;
&lt;p&gt;Anyway. I&#39;m sure you&#39;ll just think I&#39;m practicing my sales speak so I&#39;ll stop there :) (I’m not damnit!). As I said I&#39;ll be working as a consultant, which means I&#39;m dependent on customers wanting interfaces made. So feel free to &lt;a href=&#34;/contact/&#34;&gt;contact me&lt;/a&gt; or &lt;a href=&#34;http://www.valtech.se/templates/Page.aspx?id=2057&#34;&gt;my employer&lt;/a&gt; (Swedish link) if you have an interesting project you need help with.&lt;/p&gt;
&lt;p&gt;(Don&#39;t worry, I won&#39;t stop posting here, I have a big post about my first project coming up)&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Correcting the 20 pro tips (.NET magazine)</title>
            <link href="http://friendlybit.com/css/correcting-the-20-pro-tips/" rel="alternate" type="text/html" title="Correcting the 20 pro tips (.NET magazine)" />
            <published>2006-07-26T05:01:06+02:00</published>
            <updated>2006-07-26T05:01:06+02:00</updated>
            <id>http://friendlybit.com/css/correcting-the-20-pro-tips/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">.NET magazine is a fairly big web development magazine. I&#39;ve recently been referenced to its articles from many separate places, and often found the...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/correcting-the-20-pro-tips/">
                &lt;p&gt;.NET magazine is a fairly big web development magazine. I&#39;ve recently been referenced to its articles from many separate places, and often found the articles to be of good quality. The last one, called &lt;a href=&#34;http://www.netmag.co.uk/zine/design-tutorials/20-pro-tips&#34;&gt;20 pro tips&lt;/a&gt;, was not too good though, so I&#39;m going to go through and correct it. I&#39;m not trying to attack the magazine here (remember &amp;quot;friendly&amp;quot; in the URL), I just want people to know these things.&lt;/p&gt;
&lt;p&gt;The article consists of 20 points that a pro should know. Here are the points I found errors in:&lt;/p&gt;
&lt;h2 id=&#34;stylesheets-importing-vs-linking-point-3&#34;&gt;Stylesheets: importing vs linking (point 3)&lt;a href=&#34;#stylesheets-importing-vs-linking-point-3&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The point is that importing is better than linking since many older browsers will not apply the CSS then. This is correct but they also go as far as suggesting developers to add a separate stylesheet for Netscape 4 (NS4). As someone that has experimented with NS4 I can say that its CSS support is bad. Really bad. Considering the near zero percent of NS4 users I would strongly advise against fixing your site for it. That is of course, unless your site logs suggests you have a lot of users with that (old) browser.&lt;/p&gt;
&lt;p&gt;There&#39;s also a code error here, simple.css is included twice, and the second @import reference should probably be advanced.css. Not a big error but might confuse someone.&lt;/p&gt;
&lt;h2 id=&#34;smarter-gradient-backgrounds-point-4&#34;&gt;Smarter gradient backgrounds (point 4)&lt;a href=&#34;#smarter-gradient-backgrounds-point-4&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Again a good point. CSS can be used to repeat background images on any element, not just body. This means you can save on file size by replacing big images with smaller ones. The article then suggests using 1 pixel wide images which is something old versions of IE has problems with. A lot of repetitions can easily get the browser very slow so my best bet would be to make them at least 5 pixels wide.&lt;/p&gt;
&lt;p&gt;In the code you would be better off using shorthand notation (I know, this is not a big deal). To add an extra pedagogic twist something else than body could have been used:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;form&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;white&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sx&#34;&gt;background.png&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;repeat-x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;ie-box-model-hack-point-8&#34;&gt;IE Box Model Hack (point 8)&lt;a href=&#34;#ie-box-model-hack-point-8&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A lot of confusion here. Internet Explorer 5 (IE5) uses another box model than the modern browsers. The padding and border are not added to the outside of a specified width, but instead included in it. This means that if you specify a 500 pixel wide box and add a 10 pixel border to it, it will still be 500 pixels wide. Some say that this is a better way of calculating widths but that&#39;s missing the point. The point is that according to the W3C box model the padding should be added &lt;em&gt;outside&lt;/em&gt; of the width.&lt;/p&gt;
&lt;p&gt;This problem does not appear in Internet Explorer 6 (IE6) if you &lt;a href=&#34;/css/cross-browser-strategies-for-css/#mode&#34;&gt;include a proper Doctype&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So IE5 is broken, should you care? Again, check your logs if people still use the ancient IE5. My guess is that they don&#39;t which saves you a lot of work. There&#39;s probably &lt;em&gt;no need for this hack&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Also, the &lt;a href=&#34;http://tantek.com/CSS/Examples/boxmodelhack.html&#34;&gt;Box model hack&lt;/a&gt; is Tantek&#39;s hack using the voice-family property to add a &amp;quot;}&amp;quot; to your CSS. It&#39;s really ugly. The article uses the same name for another solution to the problem: wrapping the offending element in another element and moving the padding to that box. That&#39;s a much cleaner way of fixing the problem.&lt;/p&gt;
&lt;h2 id=&#34;space-saver-point-9&#34;&gt;Space saver (point 9)&lt;a href=&#34;#space-saver-point-9&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Don&#39;t use inline styles for styling. Try to keep all your styles in the external CSS file. Two more general ways of saving space across browsers are outlined in my &lt;a href=&#34;/css/cross-browser-strategies-for-css/#default&#34;&gt;cross-browser CSS article&lt;/a&gt; (the star-selector and using a premade CSS file that resets browser defaults.&lt;/p&gt;
&lt;h2 id=&#34;format-fundamentals-point-11&#34;&gt;Format fundamentals (point 11)&lt;a href=&#34;#format-fundamentals-point-11&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Good points about image formats. Use 8-bit PNGs instead of GIF, it makes you smaller files.&lt;/p&gt;
&lt;p&gt;An addition: JPEGs are generally smaller than 32-bit PNGs but that&#39;s because JPEG removes information in your image to improve compression. Remember that, if you use JPEG.&lt;/p&gt;
&lt;p&gt;If you use PNG you need to know that IE has problems showing them in the exact correct color (&lt;a href=&#34;http://hsivonen.iki.fi/png-gamma/&#34;&gt;technical explanation of the PNG color problem&lt;/a&gt;). If that matters a lot to you, use another format (remember that all PNGs change color in IE, so images still match each other). Friendly Bit uses PNGs only.&lt;/p&gt;
&lt;h2 id=&#34;the-title-and-alt-attributes-point-12&#34;&gt;The ‘title’ and ‘alt’ attributes (point 12)&lt;a href=&#34;#the-title-and-alt-attributes-point-12&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Don&#39;t use the title attribute unless it&#39;s needed to convey what you mean. In the example it does not make sense at all, why repeat the alt text? The main point is still true though, always use the alt attribute and make good use of the title attribute.&lt;/p&gt;
&lt;h2 id=&#34;wrapping-text-around-images-point-17&#34;&gt;Wrapping text around images (point 17)&lt;a href=&#34;#wrapping-text-around-images-point-17&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Come on! Using the align attribute is going against what was just recommended, use of semantic markup (point 14). Alignment is style and should be added through CSS, nothing else. Adding a strict Doctype and validating will generate an error on this kind of ugliness. Use &lt;span class=&#34;float: left &#34;&gt;&lt;code&gt;img.typeOfImage&lt;/code&gt;&lt;/span&gt; instead.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p class=&#34;first&#34;&gt;
  That&#39;s it for now, hope you learned something. I just wanted to make sure my readers know more than the .NET readers :)
&lt;/p&gt;


            </content>
        </entry>
    
        <entry>
            <title type="html">Static and dynamic CSS combined</title>
            <link href="http://friendlybit.com/css/static-and-dynamic-css-combined/" rel="alternate" type="text/html" title="Static and dynamic CSS combined" />
            <published>2006-07-16T18:56:03+02:00</published>
            <updated>2006-07-16T18:56:03+02:00</updated>
            <id>http://friendlybit.com/css/static-and-dynamic-css-combined/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Some of you have probably heard &#34;dynamic CSS&#34;. It originates from a need to serve different CSS at different times, to different people, or on different...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/static-and-dynamic-css-combined/">
                &lt;p&gt;Some of you have probably heard &amp;quot;dynamic CSS&amp;quot;. It originates from a need to serve different CSS at different times, to different people, or on different pages. You do this by first generating the CSS on the server and then sending it off to the users requesting it. There are problems though, since the CSS gets regenerated each time you lose the advantage of caching. You could send HTTP headers so that the file gets cached anyway, but then it&#39;s no longer dynamic right? This article presents a way to both have dynamic CSS that changes on each request, and make sure the user loads it from cache when it can.&lt;/p&gt;
&lt;h2 id=&#34;how-dynamic-css-works&#34;&gt;How dynamic CSS works&lt;a href=&#34;#how-dynamic-css-works&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Sometimes you want to send a different set of CSS rules depending on what page you are on. An example could be if your site was module based. Depending on what page you surf to you might get a calendar, some list of latest news or a small box showing the weather in, say, Stockholm.&lt;/p&gt;
&lt;p&gt;The functionallity is not too hard to build with some server side language, but what about the CSS? Is it really necessary to load the calendar&#39;s CSS on the news page, where the calendar is hidden? The same thing applies for each of the modules you have on your site; that list of news has certain CSS rules tied to it that isn&#39;t needed on the gallery page. You get the point. So how do we solve this? We could do it my generating it on the fly (I&#39;m using PHP here, but any other language would work):&lt;/p&gt;
&lt;p&gt;PHP source:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;PHP&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;// This line makes sure the browser handles&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;// the file as CSS and not PHP.&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Content-Type: text/css&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;

&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$module&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;calendar&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
   &lt;span class=&#34;k&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;&lt;/span&gt;
&lt;span class=&#34;s1&#34;&gt;      .calendar { width: 300px; }&lt;/span&gt;
&lt;span class=&#34;s1&#34;&gt;      .calendar table { background: pink;}&lt;/span&gt;
&lt;span class=&#34;s1&#34;&gt;   &amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$module&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;newslist&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
   &lt;span class=&#34;k&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;&lt;/span&gt;
&lt;span class=&#34;s1&#34;&gt;      .newslist { list-style: none; }&lt;/span&gt;
&lt;span class=&#34;s1&#34;&gt;      .newslist li { display: inline; }&lt;/span&gt;
&lt;span class=&#34;s1&#34;&gt;   &amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;and&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;so&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;on&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;every&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;module&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;added&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;span class=&#34;cp&#34;&gt;?&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Generated file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;calendar&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;300&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;calendar&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;pink&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;newslist&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;list-style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;none&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;newslist&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;display&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;inline&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You save this file as &amp;quot;dynamic_stylesheet.php&amp;quot; and link it like you would if it was a static CSS file. Everything works fine and all the dynamic CSS makes the file sent to the user quite small. Both you and your users are all happy. The site starts growing.&lt;/p&gt;
&lt;h2 id=&#34;problems-with-dynamic-css&#34;&gt;Problems with dynamic CSS&lt;a href=&#34;#problems-with-dynamic-css&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;After a while you start getting reports of the site getting slow. After some research you find that it&#39;s in fact the dynamic CSS that does it. The file has gotten quite big and regenerating it each time is a lot of work. So you read up on caching and find that all that&#39;s needed is a few lines at the top of your dynamic CSS file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;PHP&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Cache-control: must-revalidate&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Expires: &amp;#39;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;gmdate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;D, d M Y H:i:s&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3600&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39; GMT&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;cp&#34;&gt;?&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This makes the browser load the file from cache for one hour instead of requesting it again. Problem solved! Right? Well, this means that you won&#39;t get a regenerated file if you visit a new page on the site. The browser will load the style from cache instead and your users will get an unstyled calendar (or any other module) for an hour. Pretty annoying if you ask me.&lt;/p&gt;
&lt;p&gt;Say we solve the problem above and get the page to only get cached on a per page basis. There&#39;s still something that feels like a bit of a waste: we require the user to download the entire page again if just one of the modules changes. Say the user moves from the news list to checking out a certain news item. They will probably look pretty much the same, it&#39;s just that the news list&#39;s CSS won&#39;t be needed on the news item page. We would need some way of only telling the browser to only cache parts of the files and make the loading of those parts dynamic.&lt;/p&gt;
&lt;h2 id=&#34;import-to-the-rescue&#34;&gt;@import to the rescue&lt;a href=&#34;#import-to-the-rescue&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Caching only fragments of your style is certainly doable in a lot of ways. The easiest I have found is using CSS&#39;s own @import command. You simply change the example above to:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;PHP&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;// This line makes sure the browser handles&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;// the file as CSS and not PHP.&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Content-Type: text/css&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;

&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$module&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;calendar&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
   &lt;span class=&#34;k&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;&lt;/span&gt;
&lt;span class=&#34;s1&#34;&gt;      @import &amp;quot;calendar.css&amp;quot;;&lt;/span&gt;
&lt;span class=&#34;s1&#34;&gt;   &amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$module&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;newslist&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
   &lt;span class=&#34;k&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;&lt;/span&gt;
&lt;span class=&#34;s1&#34;&gt;      @import &amp;quot;newslist.css&amp;quot;;&lt;/span&gt;
&lt;span class=&#34;s1&#34;&gt;   &amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;// ...and so on every new module added&lt;/span&gt;
&lt;span class=&#34;cp&#34;&gt;?&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Generated file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;import&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;calendar.css&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;import&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;newslist.css&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This makes the individual CSS files get cached by the browser (just like directly linking a CSS file would) while still allowing each page to dynamically add the style blocks it needs. A simple solution to a hard problem, just the kind of solutions I like best. What do you think?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Finer details of floats</title>
            <link href="http://friendlybit.com/css/finer-details-of-floats/" rel="alternate" type="text/html" title="Finer details of floats" />
            <published>2006-07-09T15:40:06+02:00</published>
            <updated>2006-07-09T15:40:06+02:00</updated>
            <id>http://friendlybit.com/css/finer-details-of-floats/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">The other day I was working on one of those two column layouts. I quickly got into trouble by something I thought was a bug. It was a bug, but not in the...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/finer-details-of-floats/">
                &lt;p&gt;The other day I was working on one of those two column layouts. I quickly got into trouble by something I thought was a bug. It was a bug, but not in the browser(s) I thought. Let&#39;s go.&lt;/p&gt;
&lt;p&gt;A two column layout I said, but this one was a bit different. Each column consisted of a number of boxes, much like a newspaper kind of layout. I wanted the boxes ordered a bit different though: Content editors on the site ordered articles by importance in a single list and when that was transferred to a two column layout I wanted the second most important article to the right of the first article rather than below it. In the HTML source the boxes were ordered like the editors wanted and my job was to make them display in two columns.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/files/textcolumns/textcolumns.png&#34; alt=&#34;Number 1 to the left, number 2 to the right, number 3 below number 1 to the left, number 4 below number 2 to the right and so on...&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;This can&#39;t be that difficult&amp;quot; I thought and floated all odd numbered divs to the left and all even numbered divs to the right. Behold the &lt;a href=&#34;/files/textcolumns/textcolumns.html&#34; data-no-instant&gt;huge gap&lt;/a&gt; on the left side. I was stumbled. IE displayed it like I thought it worked, Firefox and Opera both displayed the gap (note to self: it&#39;s seldom a bug if both Fx and Op display it the same).&lt;/p&gt;
&lt;p&gt;So, where does the gap come from? I went looking in the &lt;a href=&#34;http://www.w3.org/TR/CSS21/visuren.html#float-position&#34;&gt;CSS specification on float positioning&lt;/a&gt; and found an interesting list of the rules that govern floats. As with almost all specifications they are not meant to be easy to read, so made a version of them where I use some sample code to explain each of the rules.&lt;/p&gt;
&lt;p&gt;This is the sample code you need to have in mind:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;parent&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;child&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;...&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;child2&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;...&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;child&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;child2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;#child and #child2 must stay to the right of #parent&#39;s left border.&lt;/li&gt;
&lt;li&gt;#child2 must be to the right of #child since #child is earlier in the source. If there is not enough space to the right of #child, #child2 must be moved below #child instead.&lt;/li&gt;
&lt;li&gt;If #child2 was floated right and #child and #child2 could not be fitted on the same line, they still must not overlap.&lt;/li&gt;
&lt;li&gt;#child and #child2 must stay below #parent&#39;s top border.&lt;/li&gt;
&lt;li&gt;#child2&#39;s top border may not be higher than #child&#39;s top.&lt;/li&gt;
&lt;li&gt;If #child was display: inline; #child2 must still not be above it.&lt;/li&gt;
&lt;li&gt;With #child and #child2 both floated left on the same line, #child2 may not stick out outside of #parent&#39;s right edge, unless it is already as far to the left as possible.&lt;/li&gt;
&lt;li&gt;#child and #child2 must be placed as high as possible&lt;/li&gt;
&lt;li&gt;#child and #child2 must be placed as far to the left as possible.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The tricky one here is rule 5. It means that if #child was moved down for some reason, #child2 will have to move down too. Check &lt;a href=&#34;/files/textcolumns/textcolumns.html&#34; data-no-instant&gt;the example again&lt;/a&gt;. See the space above box5 and compare it to the top of box4. Box5 can&#39;t be above box4 according to rule 5 above. This is clearly what&#39;s going on here. If we made box2 smaller than box1 there would be a space above it by the same reason.&lt;/p&gt;
&lt;p&gt;Note that the list of rules is a prioritized list; rules earlier in the list are more important than the latter ones. To Internet Explorer, rule 8 seems to be more important than rule 5. Strange move by IE.&lt;/p&gt;
&lt;p&gt;I hope this gave you an &amp;quot;Aha!&amp;quot; feeling, it certainly gave me.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Challenge: Marking up the world cup</title>
            <link href="http://friendlybit.com/css/challenge-marking-up-the-world-cup/" rel="alternate" type="text/html" title="Challenge: Marking up the world cup" />
            <published>2006-07-03T23:25:37+02:00</published>
            <updated>2006-07-03T23:25:37+02:00</updated>
            <id>http://friendlybit.com/css/challenge-marking-up-the-world-cup/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">It&#39;s at the end of the world cup and it&#39;s everywhere (fotball for those that live in a cave :). It might be that I spend too much time with thinking about...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/challenge-marking-up-the-world-cup/">
                &lt;p&gt;It&#39;s at the end of the world cup and it&#39;s everywhere (&lt;em&gt;fotball&lt;/em&gt; for those that live in a cave :). It might be that I spend too much time with thinking about the web but I got this little markup issue on my mind. I&#39;m not entirely sure how I would solve it but I have some ideas.&lt;/p&gt;
&lt;p&gt;How would you mark up the FIFA World cup 2006 &lt;a href=&#34;http://en.wikipedia.org/wiki/2006_FIFA_World_Cup#Bracket&#34;&gt;single elimination bracket&lt;/a&gt;? If you don&#39;t know what it is, have a look at the page linked to. It&#39;s basically 16 teams that play against eachother, one to one so half of the teams get kicked out in each step. Next step is with 8 teams, 4 teams ans so on. Pretty straight forward.&lt;/p&gt;
&lt;p&gt;Now. Say you got contacted by FIFA to make that chart to put up on the web. Very skilled in Web Standards like you are, you start to think about what kind of data this really is. Is it a list? Ordered, unordered, nested? Is it a table, with the rounds as headers? Is it perhaps a definition list, mapping games played to teams? I don&#39;t have any 100% true answers, I&#39;m hoping for your help there.&lt;/p&gt;
&lt;p&gt;The second problem is of course the style. What methods would you use? There&#39;s quite a lot of boxes to place. Percentages? Can you make it zoom well?&lt;/p&gt;
&lt;p&gt;Pasting code in comments to this blog is a bad idea (they just get messed up), so put it up on your own site instead an link to it by leaving a comment. Add a little explaination of your thinking of you wish. Can you do it?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Here&#39;s my suggestion of &lt;a href=&#34;/files/worldcup/worldcup_bracket.html&#34; data-no-instant&gt;markup and CSS for the world cup bracket&lt;/a&gt;.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Reminder: Cross browser font sizes</title>
            <link href="http://friendlybit.com/css/reminder-cross-browser-font-sizes/" rel="alternate" type="text/html" title="Reminder: Cross browser font sizes" />
            <published>2006-06-30T18:15:09+02:00</published>
            <updated>2006-06-30T18:15:09+02:00</updated>
            <id>http://friendlybit.com/css/reminder-cross-browser-font-sizes/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">I&#39;m sure most of you have already read the excellent experiment on font sizes but it&#39;s important enough to summarice here. The problem is how to make as...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/reminder-cross-browser-font-sizes/">
                &lt;p&gt;I&#39;m sure most of you have already read the &lt;a href=&#34;http://www.thenoodleincident.com/tutorials/box_lesson/font/index.html&#34; title=&#34;Noodleincidents guide on font sizes&#34;&gt;excellent experiment&lt;/a&gt; on font sizes but it&#39;s important enough to summarice here.&lt;/p&gt;
&lt;p&gt;The problem is how to make as many browsers as possible display fonts in the same size, without using pixels or other absolute units. Why shouldn&#39;t you use fixed font sizes? Because they make Internet Explorer unable to zoom the text with text-zoom, something that&#39;s bad for accessibility.&lt;/p&gt;
&lt;p&gt;When you start experimenting with this problem you quickly get into problems. I tested in Firefox 1.5, Internet Explorer 6 and Opera 9 and it was incredibly hard (Want a challange? Don&#39;t read on, try it by yourself) even with just those few browsers. Opera has problems with units it seems. If you use em:s you can&#39;t use more than two decimals, Opera will round it them differently than the others.&lt;/p&gt;
&lt;p&gt;Anyway, Owen Briggs solved this for us in a very simple way:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;c&#34;&gt;/* Set the size in percent on the body */&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;font-size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;76&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;/* All other sizes should be in em units with maximum of one decimal */&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;font-size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;font-size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;font-size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;1.8&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;From my simple tests it seems to work fine. Did you know?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Beyond the web with CSS: PrinceXML and S5</title>
            <link href="http://friendlybit.com/css/beyond-the-web-with-css-princexml-and-s5/" rel="alternate" type="text/html" title="Beyond the web with CSS: PrinceXML and S5" />
            <published>2006-06-25T00:37:34+02:00</published>
            <updated>2006-06-25T00:37:34+02:00</updated>
            <id>http://friendlybit.com/css/beyond-the-web-with-css-princexml-and-s5/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Right now, depending on what kind of presentation you will be doing, you use different techniques. I&#39;m not talking about &#34;presentation&#34; as in design here,...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/beyond-the-web-with-css-princexml-and-s5/">
                &lt;p&gt;Right now, depending on what kind of presentation you will be doing, you use different techniques. I&#39;m not talking about &amp;quot;presentation&amp;quot; as in design here, I&#39;m talking about web sites, printed paper, slide shows and so on, different types of media. How many of you use the print feature in browsers for your reports? Didn&#39;t think so.&lt;/p&gt;
&lt;p&gt;Wouldn&#39;t it be nice if there was only one set of standards you needed to learn? One set that worked for all kinds of documents. One where encoding problems of differences in alphabets had been solved. One with a huge community of developers that gave of their time to help you with problems. Wouldn&#39;t that be nice? Good thing that set of standards exist: HTML and CSS.&lt;/p&gt;
&lt;h2 id=&#34;printing-like-it-once-was-word-and-latex&#34;&gt;Printing like it once was: Word and LaTeX&lt;a href=&#34;#printing-like-it-once-was-word-and-latex&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The ordinary Windows user uses &lt;a href=&#34;http://office.microsoft.com/word&#34;&gt;Mircosoft Word&lt;/a&gt; for editing text. Word is popular for its ease of use and hides all the code from the user, instead showing the document like it will be printed. This of course pushes the filesizes up because of inefficient code, just like with any &lt;acronym title=&#34;What you see is what you get&#34;&gt;WYSIWYG&lt;/acronym&gt; editor. Word supports the separation of structure and design by it&#39;s templates but hides this feature behind menu selections instead of promoting it as the preferred method. It also uses a proprietary format for storing the documents, something that makes sharing documents harder. Word costs a lot, but if you&#39;re lucky it&#39;s included when you buy your Windows machine.&lt;/p&gt;
&lt;p&gt;For scientific work, &lt;a href=&#34;http://www.latex-project.org/&#34;&gt;LaTeX&lt;/a&gt; is very popular. LaTeX takes a very different approach from Word at editing text by requiring the user to mark up structure with its own markup format. It comes with a few predefined designs that you pick among by writing some markup in the beginning of the document. The document is then compiled by a command line program into an intermediary format that can be sent to a printer. If you know what you&#39;re doing, this makes it easy to get those default designs out fast. The problem with LaTeX is when you &lt;em&gt;do&lt;/em&gt; want to change the design. This requires you to dig deep into TeX syntax, a language not known for its ease of use.&lt;/p&gt;
&lt;p&gt;Example of some LaTeX code:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;LATEX&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;\\&lt;/span&gt;documentclass&lt;span class=&#34;nb&#34;&gt;{&lt;/span&gt;article&lt;span class=&#34;nb&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;\\&lt;/span&gt;title&lt;span class=&#34;nb&#34;&gt;{&lt;/span&gt;Cartesian closed categories and the price of eggs&lt;span class=&#34;nb&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;\\&lt;/span&gt;author&lt;span class=&#34;nb&#34;&gt;{&lt;/span&gt;Jane Doe&lt;span class=&#34;nb&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;\\&lt;/span&gt;date&lt;span class=&#34;nb&#34;&gt;{&lt;/span&gt;September 1994&lt;span class=&#34;nb&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;\\&lt;/span&gt;begin&lt;span class=&#34;nb&#34;&gt;{&lt;/span&gt;document&lt;span class=&#34;nb&#34;&gt;}&lt;/span&gt;
   &lt;span class=&#34;k&#34;&gt;\\&lt;/span&gt;maketitle
   Hello world!
&lt;span class=&#34;k&#34;&gt;\\&lt;/span&gt;end&lt;span class=&#34;nb&#34;&gt;{&lt;/span&gt;document&lt;span class=&#34;nb&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;printing-with-web-standards-princexml&#34;&gt;Printing with web standards: PrinceXML&lt;a href=&#34;#printing-with-web-standards-princexml&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The runner up in the print category is &lt;a href=&#34;http://princexml.com/&#34;&gt;PrinceXML&lt;/a&gt;. It&#39;s based on ordinary (X)HTML/XML together with CSS and outputs PDF documents ready for printing. The CSS support is quite remarkable, managing to render the &lt;a href=&#34;http://webstandards.org/action/acid2/&#34;&gt;Acid2 test&lt;/a&gt; according to standard and supporting new CSS3 features like cross-references without problem. The handling of page sizes, page footers and headers comes from the &lt;a href=&#34;http://www.w3.org/TR/css3-page/&#34;&gt;CSS3 Paged Media&lt;/a&gt; module and too works well from my testing.&lt;/p&gt;
&lt;p&gt;Below you can see an example of what can be done in PrinceXML. First we add a counter that keeps track of what number each block with the classname figure as. Then we add that number before the figure&#39;s caption. Lastly we add a parantesis with the figure number too all links that link to a certain figure.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;figure&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;counter-increment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fig&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;figure&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;caption&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nd&#34;&gt;before&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;Figure #&amp;quot;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;counter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fig&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;: &amp;quot;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;^=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;#fig_&amp;quot;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nd&#34;&gt;after&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot; (see figure &amp;quot;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;target-counter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;attr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fig&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;)&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I am currently using the program for my degree thesis, a 34 page giant that has quite strict rules it needs to follow for styling. PrinceXML handles things just like it should. It costs a bit, but if you write a lot of documents it&#39;s probably worth it. If you can handle a promotional first page a &lt;a href=&#34;http://princexml.com/download/&#34;&gt;free trial version&lt;/a&gt; is available on the web site.&lt;/p&gt;
&lt;h2 id=&#34;slide-shows-like-they-once-were-powerpoint&#34;&gt;Slide shows like they once were: PowerPoint&lt;a href=&#34;#slide-shows-like-they-once-were-powerpoint&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Microsoft is in the lead in the slide show area too with its well known &lt;a href=&#34;http://office.microsoft.com/powerpoint&#34;&gt;Microsoft PowerPoint&lt;/a&gt;. Interestingly PowerPoint goes a long way towards separation with it&#39;s easy to use layout modes. You pick a layout from a easy to overview list of options and then just click and type to fill it with your content. What isn&#39;t included is design. Much like LaTeX, PowerPoint lets you pick from a number of premade templates but makes it hard to make your own. Given that ease of use is more important for PowerPoint than customization you could say that the product is successful. For someone like me though, that wants to make my own designs, learning how to make PowerPoint templates isn&#39;t easy enough to be interesting. PowerPoint also uses a proprietary format and costs &lt;em&gt;mucho dinero&lt;/em&gt;, but if you are lucky it was included when you bought your computer.&lt;/p&gt;
&lt;h2 id=&#34;slide-shows-with-web-standards-s5&#34;&gt;Slide shows with web standards: S5&lt;a href=&#34;#slide-shows-with-web-standards-s5&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Eric Meyer is the author of a web standards based &lt;a href=&#34;http://meyerweb.com/eric/tools/s5/&#34;&gt;slide show system called S5&lt;/a&gt;. It&#39;s rather easy to use for someone used to HTML and CSS. Pick your favourite properly marked up HTML file, add &lt;code&gt;&amp;lt;div class=&amp;quot;slide&amp;quot;&amp;gt;&lt;/code&gt; around a block of content you want on its own slide, link some javascript and CSS and you&#39;re ready to go. The slide show is then run in a web browser in fullscreen mode. It supports incremental display and resizes with the browser window, just like PowerPoint. It&#39;s also completly free.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary&lt;a href=&#34;#summary&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It &lt;em&gt;is&lt;/em&gt; possible to use HTML and CSS for both web, print and slide shows. In fact you can combine all of them and by using the media attribute on your link elements. That way the same document can be shown on the web, be rendered as a PDF in PrinceXML and displayed in a slideshow with S5.&lt;/p&gt;
&lt;p&gt;Isn&#39;t this standards stuff quite fantastic?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Real hackers don’t use CSS</title>
            <link href="http://friendlybit.com/css/real-hackers-dont-use-css/" rel="alternate" type="text/html" title="Real hackers don’t use CSS" />
            <published>2006-06-11T15:15:58+02:00</published>
            <updated>2006-06-11T15:15:58+02:00</updated>
            <id>http://friendlybit.com/css/real-hackers-dont-use-css/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Back in the old days of 1996 there were two kinds of people. Those who understood the web, often referred to as &#34;hackers&#34;, and those that didn&#39;t. A hacker...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/real-hackers-dont-use-css/">
                &lt;p class=&#34;first&#34;&gt;
  Back in the old days of 1996 there were two kinds of people. Those who understood the web, often referred to as &#34;hackers&#34;, and those that didn&#39;t. A &lt;em&gt;hacker&lt;/em&gt; could throw together a website in a few minutes, filled with the latest possibilities that the web offered: animated gifs, scrolling marquee text and blinking red text for the really important stuff. It was a glorious time and the hackers really ruled the web. It started growing.
&lt;/p&gt;

&lt;h2 id=&#34;hackers-and-designers&#34;&gt;Hackers and designers&lt;a href=&#34;#hackers-and-designers&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;With growth came the &lt;em&gt;designers&lt;/em&gt;. They wanted to use the web just like the unlimited piece of paper it was. So they sent their designs, the same designs they had previously printed, to the hackers and said: &amp;quot;I want this on the web&amp;quot;. The hackers looked at the designs and didn&#39;t like them at all. But the designers were the ones paying their salaries so they had no chance but to do what the designers wanted.&lt;/p&gt;
&lt;p&gt;When the hackers started working they quickly came to the conclusion that this was harder than they had predicted. Then a smart guy that really knew his way around the web found a tutorial describing how to do something called &amp;quot;image maps&amp;quot;. The hackers cheered! They could take the dreaded designs and put them up on the web as images. Then add transparent clickable areas on top of the images that linked to other images. The hackers&#39; status had been reinstated and the designers looked at the results and were happy, &amp;quot;It looks just like we want&amp;quot; they said.&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-a-website-a-hackers-guide&#34;&gt;How to make a website, a hacker’s guide:&lt;a href=&#34;#how-to-make-a-website-a-hackers-guide&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Convert the designers images to JPG&lt;/li&gt;
&lt;li&gt;Add an image-map to each one of them&lt;/li&gt;
&lt;li&gt;Make sure all links work&lt;/li&gt;
&lt;li&gt;Show the designers&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;hackers-and-customers&#34;&gt;Hackers and customers&lt;a href=&#34;#hackers-and-customers&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Here entered the &lt;em&gt;customers&lt;/em&gt;. The company website, that looked just like the designers wanted and was coded just like the hackers wanted, was very slow. Sometimes it took over 15 minutes for the customers to get the info they wanted from the site. Phones started ringing in the hackers&#39; offices and they all gathered to try to solve the problem. This was when the major breakthrough in the web history came.&lt;/p&gt;
&lt;p&gt;One clever hacker suggested that they split the images in many parts and used tables to put them back together. The older hackers scratched their heads, &amp;quot;Tables? Where did they hear of them before?”. After some research they found that tables were sometimes used in research reports to show a grid of values. “Just put some images in those cells instead and it will look just like before”, explained the clever hacker. He continued, &amp;quot;… but that doesn&#39;t make anything faster. To make the page faster we split it so that we can remove some parts. If there is a large block of blue somewhere we can remove that image and set a background-color on the cell instead!&amp;quot;. There was much rejoice and the hackers got to work. Many had problems dealing with splitting the images in the image programs, but after a couple of weeks of training they mastered it.&lt;/p&gt;
&lt;p&gt;The years passed by and the hackers got better and better at taming tables to do just want they wanted. Someone came with the idea of putting another table inside the first one. That made the code a little easier to maintain since they didn&#39;t require the use of row- and colspan. Additionally that made it possible to add margins to your text, something that made the designers happy. Someone came with the clever suggestion that sometimes text can be removed from the image and written in the cell instead. This made the designers a bit annoyed since sometimes the customers got the wrong font but it wasn&#39;t an issue big enough to start a fight over.&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-a-website-a-hackers-guide-emversi&#34;&gt;How to make a website, a hacker’s guide (&lt;em&gt;version 2&lt;/em&gt;):&lt;a href=&#34;#how-to-make-a-website-a-hackers-guide-emversi&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Convert the designers images to JPG&lt;/li&gt;
&lt;li&gt;Slice the images so that the big one-colored areas can be replaced with a table cell&lt;/li&gt;
&lt;li&gt;See if any of the text can be removed from the image and set in a cell&lt;/li&gt;
&lt;li&gt;Link each individual image correctly or use an image-map.&lt;/li&gt;
&lt;li&gt;Make sure all links work&lt;/li&gt;
&lt;li&gt;Show the designers&lt;/li&gt;
&lt;li&gt;Show the customers&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;hackers-and-standardists&#34;&gt;Hackers and standardists&lt;a href=&#34;#hackers-and-standardists&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The earth shook and the &lt;em&gt;web standardists&lt;/em&gt; entered the scene. The standardists said to the hackers, &amp;quot;You are doing things all wrong, you need to redo your sites and learn everything from scratch again&amp;quot;. The hackers laughed. Their customers were happy, the designers were happy, they were happy, why should they change? The standardists spoke again, &amp;quot;but your page will load faster with standards&amp;quot;. The hackers looked back and remembered how slow their sites once were, they looked at the adoption of high speed internet connections and they reckoned that speed wasn&#39;t a problem.&lt;/p&gt;
&lt;p&gt;The standardists were now annoyed, why couldn&#39;t the hackers understand why standards were better? They gave it one last chance and said &amp;quot;But if you use CSS for layout your sites will be much easier to maintain!&amp;quot;. In reply the hackers showed all their table skills they had acquired over the years. One guy had 16 nested tables to show. Another guy used frames to layout his site and had a whopping 25 frames in a spectacular pattern which all the other hackers envied. The hackers really knew what they were doing. They said, &amp;quot;There’s no need learning this new stuff, it will just take a lot of my time and it isn&#39;t any better&amp;quot;.&lt;/p&gt;
&lt;h3 id=&#34;how-to-make-a-website-a-standardists-guide&#34;&gt;How to make a website, a standardist’s guide:&lt;a href=&#34;#how-to-make-a-website-a-standardists-guide&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Look at the design the designer gave you, figure out what parts the design consists of.&lt;/li&gt;
&lt;li&gt;Start writing the HTML corresponding to those parts. Try to avoid adding elements to the HTML just for the sake of design. Make sure all content in the design is represented in the HTML (text preferable).&lt;/li&gt;
&lt;li&gt;Link a CSS file to your HTML and start adding style to the document. Test in the modern browsers and read guides with common bugs to fix problems you encounter.&lt;/li&gt;
&lt;li&gt;Show the designers and explain why they can&#39;t have it look just like it would on paper.&lt;/li&gt;
&lt;li&gt;Do user testing to determine things work or not.&lt;/li&gt;
&lt;li&gt;Release it to the customers and be open to feedback.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;a href=&#34;#conclusion&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When you, as a standardist, talk to hackers about standards, keep in mind that they are good at what they do. There&#39;s a reason they are doing it a certain way and it works. Just throwing out a &amp;quot;Tables are so -96&amp;quot; won&#39;t bite; you need to be smarter than that. Don’t forget that you were once in the same seat, and use the same arguments that made you switch.&lt;/p&gt;
&lt;p class=&#34;first&#34;&gt;
  And yes, that guy using frames for layout in the text above, was me.
&lt;/p&gt;


            </content>
        </entry>
    
        <entry>
            <title type="html">Concept: Four layers of web development</title>
            <link href="http://friendlybit.com/css/concept-four-tier-web-development/" rel="alternate" type="text/html" title="Concept: Four layers of web development" />
            <published>2006-06-03T18:45:07+02:00</published>
            <updated>2006-06-03T18:45:07+02:00</updated>
            <id>http://friendlybit.com/css/concept-four-tier-web-development/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">When thinking about web development on the client side, I tend to think of four different layers. Any (well built) framework will cater for all of these...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/concept-four-tier-web-development/">
                &lt;p&gt;When thinking about web development on the client side, I tend to think of four different layers. Any (well built) framework will cater for all of these layers and all good developers will be aware of them. The layers I&#39;m thinking about are: Data, Structure, Design, and Behavior. This article discusses all four of those and explains how they relate.&lt;/p&gt;
&lt;h2 id=&#34;data-layer&#34;&gt;Data layer&lt;a href=&#34;#data-layer&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The data layer is the most important one and strangely the one most people get confused about. HTML is &lt;em&gt;not&lt;/em&gt; the data layer, the &lt;strong&gt;content&lt;/strong&gt; is. The data layer is the raw data that you are presenting, the text, the images, the sound, the video, whatever content you want to serve. For bigger sites the data is often stored in a database or perhaps XML files somewhere and then processed server side every time someone wants to access it.&lt;/p&gt;
&lt;p&gt;This layer is also where all websites should start. What content do you have? If the content is bad no pretty design or fancy Web 2.0 technique is going to cater for that. In fact, content together with bad uses of the other layers, &lt;a href=&#34;http://www.andyrutledge.com/bad-design.php&#34;&gt;might still work&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;One last point to make about data is that you should make sure to use the best possible media for representing your content. If it can be text, use text! Don&#39;t use images for text, narrate your podcasts (or at least provide a text-summary), put your videos online with descriptions to them. Having that text there helps you convey your point, search engines will find you, your users will be able to skim read while it loads and disabled users will get access to at least some of your content.&lt;/p&gt;
&lt;h2 id=&#34;structural-layer&#34;&gt;Structural layer&lt;a href=&#34;#structural-layer&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The structural layer is where the much misunderstood HTML comes to play. HTML&#39;s job is to take the data it has received from the data layer and &lt;a href=&#34;/html/datatypes-of-html/&#34; title=&#34;Some examples of data structures you have available in HTML&#34;&gt;add some structure to it&lt;/a&gt;. Mark up what parts are headers, make sure lists get the HTML that best describes them, split the page up in the important parts and so on.&lt;/p&gt;
&lt;p&gt;HTML also adds some semantics to the data but since it&#39;s quite a limited dictionary we have to work with I believe this is secondary. If you happened to have the kind of data that HTML happens to catch with its elements be sure to use them, if not make sure you at least capture the structure of it.&lt;/p&gt;
&lt;p&gt;You know you have done this level right if your site works with nothing but data and structure.&lt;/p&gt;
&lt;h2 id=&#34;design-layer&#34;&gt;Design layer&lt;a href=&#34;#design-layer&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The design layer is where you define the looks of your data. Design requires a good basic structure to be useful. On the web you should use CSS for this layer, a language that has been built upon the idea of a solid structure and is remarkably powerful. As you know CSS targets certain elements and then defines their look. Without a solid structure this is not possible.&lt;/p&gt;
&lt;p&gt;Good designers often point out that only working with the looks of a site will not accomplish good design. They also work on the structural layer by making sure structurally important content gets the most exposure in the design. This is also strengthens the idea that structure is a layer upon which design works.&lt;/p&gt;
&lt;h2 id=&#34;behavioral-layer&#34;&gt;Behavioral layer&lt;a href=&#34;#behavioral-layer&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Behavior is the last layer I&#39;m going to talk about. It&#39;s the one that&#39;s least important; data, structure and design are all more effective in conveying your message. None the less, added behavioral functionality &lt;em&gt;can&lt;/em&gt; be powerful if executed properly on top of the other layers.&lt;/p&gt;
&lt;p&gt;Javascript is the most used language for adding new behavior to websites. With the whole &lt;a href=&#34;http://en.wikipedia.org/wiki/Web_2.0&#34;&gt;Web 2.0&lt;/a&gt; and &lt;a href=&#34;http://en.wikipedia.org/wiki/Ajax_%28programming%29&#34;&gt;AJAX&lt;/a&gt; wave we are experiencing many new sites that adds a behavioral layer without even thinking about it. We should be careful; becoming dependent on the new behavior (the site not working without it) means you will lose many potential visitors, the most important single one being search engines. Behavior should always be added separately and only enhance the experience for those that has it enabled. This is what&#39;s called unobtrusive javascript.&lt;/p&gt;
&lt;h2 id=&#34;putting-it-all-together-four-tier-web-development&#34;&gt;Putting it all together: four tier web development&lt;a href=&#34;#putting-it-all-together-four-tier-web-development&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Putting all these four parts together we get the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/files/four-tier-webdev.png&#34; alt=&#34;Adding layers step by step to a paragraph of text&#34; /&gt;&lt;/p&gt;
&lt;p&gt;Is this the same mental model you use? Let me know through comments.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Threehouse has an image up showing the four layers in the context of javascript connection the layers together.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Inline CSS should not be allowed in strict doctypes</title>
            <link href="http://friendlybit.com/css/inline-css-should-not-be-allowed-in-strict-doctypes/" rel="alternate" type="text/html" title="Inline CSS should not be allowed in strict doctypes" />
            <published>2006-05-28T22:48:10+02:00</published>
            <updated>2006-05-28T22:48:10+02:00</updated>
            <id>http://friendlybit.com/css/inline-css-should-not-be-allowed-in-strict-doctypes/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">As many of my readers already know all pages should include a doctype. The doctype tells the browser (or other user agent) what kind of document it can...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/inline-css-should-not-be-allowed-in-strict-doctypes/">
                &lt;p class=&#34;first&#34;&gt;
  As many of my readers already know all pages should include a doctype. The doctype tells the browser (or other user agent) what kind of document it can expect and what standards it follows.
&lt;/p&gt;

&lt;p&gt;You can divide doctypes into two categories. The first category consist of the &lt;em&gt;transitional&lt;/em&gt; ones, the ones that allow old syntax and still validate, and the other one consist of the strict ones. I have repeatedly &lt;a href=&#34;/css/cross-browser-strategies-for-css/#mode&#34;&gt;recommended the strict versions&lt;/a&gt; for a simple reason: it&#39;s the best ones for separating design from content.&lt;/p&gt;
&lt;p&gt;Just to show an example, transitional allows the following:&lt;/p&gt;
&lt;div class=&#34;incorrect&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;bgcolor&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;blue&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;center&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Strict, by its very nature, requires the use of CSS instead.&lt;/p&gt;
&lt;p&gt;What I find strange is that &lt;em&gt;inline CSS&lt;/em&gt; is valid in strict. Inline CSS is when you use the &lt;code&gt;style&lt;/code&gt; attribute to set design information inside of the HTML. As an example the two deprecated pieces of code above can be done with:&lt;/p&gt;
&lt;div class=&#34;incorrect&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;background: blue&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;text-align: center&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;How is that any better than the transitional versions? Inline CSS goes against all the logic involved in the idea of two distinct doctypes. Why should you want to include design information inside of a document that you just explicitly stated would separate the two?&lt;/p&gt;
&lt;p&gt;I hear the obvious reply: &amp;quot;What if I load design info from a database? I need to use inline CSS then!&amp;quot;. To me, that sounds like a perfect case where you need to go &lt;em&gt;transitional&lt;/em&gt;, if you can&#39;t manage to separate the two - don&#39;t.&lt;/p&gt;
&lt;p&gt;Strict doctypes are for documents where the webmaster has taken the time to clearly separate the content from the design, not other hybrids.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Improving the web; Blogging, Google and Web standards</title>
            <link href="http://friendlybit.com/css/improving-the-web/" rel="alternate" type="text/html" title="Improving the web; Blogging, Google and Web standards" />
            <published>2006-05-20T00:12:31+02:00</published>
            <updated>2006-05-20T00:12:31+02:00</updated>
            <id>http://friendlybit.com/css/improving-the-web/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">The web has really changed the way we do things. Remember those paper timetables? No need for them anymore, we simply type in our destination on a box and...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/improving-the-web/">
                &lt;p&gt;The web has really changed the way we do things. Remember those paper timetables? No need for them anymore, we simply type in our destination on a box and get a step by step guide for what to do. Finding recipies? No need to look through books any more, just type in a few ingredients on your favourite food site. The examples are countless but there is no time for us to sit back and relax just yet. The web &lt;em&gt;can&lt;/em&gt; be improved. We can get more people to publish their stuff online, we can get better tools for finding relevant info, and we can make the information accessible to more people. In this article I&#39;m going to talk a little about each of those three points.&lt;/p&gt;
&lt;h2 id=&#34;we-need-more-information&#34;&gt;We need more information&lt;a href=&#34;#we-need-more-information&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We need more information. People will argue and say &amp;quot;No, there&#39;s enough junk online already&amp;quot; but I don&#39;t care. More information is a good thing. The web is currently not a good representation of the world at large. The is a million technology weblogs and five about shoemaking. Another million sites about how it&#39;s like to be a teenager today and another five about life as an 80 year old. You know what I&#39;m getting at? We need a wider variety of people on the web, not only people that are just like us.&lt;/p&gt;
&lt;p&gt;Another thing to remember is that text only is one facet of information. With today’s bandwidth available we can look at live video from all over the world. We can listen to live radio and music just as easy as we read the web. We then have a look at availability. I&#39;d say that at most one out of 1000 people publishing on the web is using something else than text (This site is no exception). I know that there are people out there that have a video camera, that have a microphone, and know how to put it up on the web. But they don&#39;t.&lt;/p&gt;
&lt;p&gt;This lack of variety in information is a real problem. It builds barriers towards people we just don&#39;t know anything about and it fools us surfers to believe the world is smaller than it seems. &amp;quot;No, there can&#39;t be any problems with the Chinese government, we would have heard about it!” or what about &amp;quot;Christianity must be the biggest religion, just look at what people are writing most about&amp;quot;.&lt;/p&gt;
&lt;p&gt;There &lt;em&gt;are&lt;/em&gt; ways the tackle this problem and the concept of blogging is one of them. It makes it easy to almost anyone, anywhere to just start writing in a few minutes. You can be anonymous, you don&#39;t have to tell the truth, there&#39;s no age check and it doesn&#39;t cost you money. This opens up to real diversity on the web. The technology exists, what we need to do is get people online and make them use it. So tell your friends to pick something they love or hate and blog about it. We need more information.&lt;/p&gt;
&lt;h2 id=&#34;we-need-relevant-information&#34;&gt;We need relevant information&lt;a href=&#34;#we-need-relevant-information&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The next step, after we have gotten a larger and more diversified web, is to start filtering it. I&#39;m not talking censoring here, I mean filtering in the sense to &amp;quot;filter what you want&amp;quot;. This can be tied to a certain task you want to accomplish or it can be a strong interest of yours that you want to follow. It doesn&#39;t matter which, what matters is that there are ways to easily find relevant information.&lt;/p&gt;
&lt;p&gt;There are many ways of determining relevancy on the web and the one most successful is linking. Links are like recommendations; anyone that links to a site is telling their readers a certain site is recommended. It&#39;s relevant for the subject at hand and it contains good information. If you are just looking for random information about something looking at a few links might be enough. For example, if &lt;a href=&#34;http://www.456bereastreet.com&#34;&gt;Roger Johansson&lt;/a&gt; links to something web related I can be pretty sure it&#39;s good.&lt;/p&gt;
&lt;p&gt;For more task oriented queries we need something else. If someone is looking for a plane ticket they will probably not know who the authority in that area is. Google is the search engine that has had the greatest success with solving this problem and the solution is simple. Gather the recommendations for as many sites as possible and reply to queries with what &lt;em&gt;most&lt;/em&gt; people recommend. Just think about it, if 100 people recommend FlyPlane and 1000 people AirFlight, who would you go for?&lt;/p&gt;
&lt;p&gt;In reality it isn’t that simple, but in essence that’s how search engines work. Something that is important to note is that the system encourages people to write &lt;em&gt;good content&lt;/em&gt;. Why is that? Simply because good content gets linked to, and more links means it&#39;s probably more relevant. This way Google and all the others are actively encouraging people to improve the web. Good, isn&#39;t it?&lt;/p&gt;
&lt;h2 id=&#34;making-information-accessible&#34;&gt;Making information accessible&lt;a href=&#34;#making-information-accessible&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;So, we have lots of information from all over the world and we have the tools to find the most relevant info at any point. The last step is actually delivering the information to our users. This is where web standards come to play.&lt;/p&gt;
&lt;p&gt;In the early nineties browser makers raced to get the coolest new features included in their browsers. The result was things like blinking text, different methods of representing &amp;quot;layers&amp;quot; and scrolling text. Web developers had a hard time keeping up with browser differences and often you had to construct two or more separate pages to send people to depending on what browser they used.&lt;/p&gt;
&lt;p&gt;The W3C acknowledged this and presented a solution. Instead of browsers trying to find the coolest additions, let a standards organization handle the new additions. Let hundreds of people sit together and discuss new ideas long before they are implemented. When everyone has had a chance to say their meaning and problems has been eliminated you release a document presenting the new features together with implementation details. Now the browser makers can race over who supports the most recommended standards instead, and webmasters can just pick a set of standards that is well supported. One way of doing things instead of many incompatible ones.&lt;/p&gt;
&lt;p&gt;Right now, the current recommendation is to use the strict versions of HTML of XHTML for structure, CSS for design and Javascript for behaviour. Using those standards means that your site is accessible by more than just the few browsers you have tested with. Both people and automated crawlers that that are after just your content can easily skip your design. People with old browsers will still be able to view your content, even though they don’t see the design the still get the content.&lt;/p&gt;
&lt;p&gt;If you adopt the recommendations I mentioned above you have gotten quite far, but there is more. &lt;em&gt;Accessibility&lt;/em&gt; is an area in web development that has gotten far too little exposure. It&#39;s focused on making it easier to people with various disabilities, varying from broken arms and color blindness to dyslexia. Previously people cared about old browsers, it’s time for a shift towards caring about people instead. Read up on accessibility, Mark Pilgrim&#39;s &lt;a href=&#34;http://diveintoaccessibility.org/introduction.html&#34;&gt;Dive into Accessibilty&lt;/a&gt; is a good start.&lt;/p&gt;
&lt;h2 id=&#34;in-summary&#34;&gt;In summary&lt;a href=&#34;#in-summary&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I&#39;ve gone over three areas where I believe there is space for improvement on the web.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;More diversified information. Get your friends on the web!&lt;/li&gt;
&lt;li&gt;Better tools for filtering all the information depending on what we need. Build new and better tools for doing this!&lt;/li&gt;
&lt;li&gt;Use web standards and care about accessibility. I try to help in this area with the help of this blog.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now I&#39;m interested in your comments. What do you think? Are there more areas we need to look into?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Emulating tables: Automatic width</title>
            <link href="http://friendlybit.com/css/emulating-tables-automatic-width/" rel="alternate" type="text/html" title="Emulating tables: Automatic width" />
            <published>2006-05-07T01:59:50+02:00</published>
            <updated>2006-05-07T01:59:50+02:00</updated>
            <id>http://friendlybit.com/css/emulating-tables-automatic-width/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Moving from tables to layouts based on CSS is a tough move for many. Things don&#39;t behave the way they use to and some effects are much harder to do with...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/emulating-tables-automatic-width/">
                &lt;p&gt;Moving from tables to layouts based on CSS is a tough move for many. Things don&#39;t behave the way they use to and some effects are much harder to do with CSS. This article is about one of the tricks you might want when trying to get table-like effects using CSS: the dynamic width column, where you let the width be decided by an image. You may jump ahead and look at the &lt;a href=&#34;/files/dynamic_left_column/&#34; data-no-instant&gt;dynamic width column&lt;/a&gt; right away if you want.&lt;/p&gt;
&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;a href=&#34;#the-problem&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;What we are after is a way to emulate a simple effect when using tables. Look at this code:&lt;/p&gt;
&lt;div class=&#34;incorrect&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;/files/post-media/huvet_southpark.png&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Some sample text here&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The code above will render two columns, and the width of the left one will be equal to the width of the image. This can be useful on a very dynamic site, where you don&#39;t know the width of the image and so you don&#39;t want to set it using CSS.&lt;/p&gt;
&lt;p&gt;Looking at the code above you might see the problem though. Tables are for tabular data, and and image and some text are certainly not tabular. We need something better.&lt;/p&gt;
&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;a href=&#34;#the-solution&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When you start to look at the problem you quickly realize that the image needs to be floated. There is just a few ways to put things side by side in CSS and floating is one of the few ways that works like we want it to. The image moves to the left and text flows around it. This looks all nice but if you add a border the other column you see that they are not really side by side. All that has happened is that the &lt;em&gt;text&lt;/em&gt; has been moved to the left, not the container.&lt;/p&gt;
&lt;p&gt;This can be solved by setting &lt;code&gt;overflow: auto;&lt;/code&gt; on the right column. After setting this the container nicely contracts and sits where it should. IE6 doesn&#39;t play by the same rules though. Here you instead need to set &lt;code&gt;height: 1%;&lt;/code&gt; to make it behave.&lt;/p&gt;
&lt;p&gt;This final CSS looks like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;cartoon&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;overflow&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;auto&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;auto&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;!important&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; After Rowan Lewis suggestion I now use &lt;code&gt;height: auto !important;&lt;/code&gt; to send a correct height to modern browsers. IE6 does not understand &lt;code&gt;!important&lt;/code&gt; and will therefore overwrite the height with the 1% value.&lt;/p&gt;
&lt;p&gt;And the following HTML:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;example&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;/files/post-media/huvet_southpark.png&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;cartoon&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      Here&amp;#39;s all the text
      Even more text here!
      Even more text here!
      Even more text here!
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Have a look at the example of the &lt;a href=&#34;/files/dynamic_left_column/&#34; data-no-instant&gt;table-like behaviour&lt;/a&gt;.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Open letter to the IE Team</title>
            <link href="http://friendlybit.com/css/open-letter-to-the-ie-team/" rel="alternate" type="text/html" title="Open letter to the IE Team" />
            <published>2006-05-03T13:37:07+02:00</published>
            <updated>2006-05-03T13:37:07+02:00</updated>
            <id>http://friendlybit.com/css/open-letter-to-the-ie-team/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Dear IE Team, I have carefully followed the development of Internet Explorer 7 (IE7) and really liked what I&#39;ve seen. Especially the CSS bugfixes are...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/open-letter-to-the-ie-team/">
                &lt;p class=&#34;first&#34;&gt;
  Dear IE Team,
&lt;/p&gt;

&lt;p class=&#34;first&#34;&gt;
  I have carefully followed the development of Internet Explorer 7 (IE7) and really liked what I&#39;ve seen. Especially the CSS bugfixes are wonderful, the tabs are really needed, and the team talking about the development on your blog is really nice too. You are doing a great job and you should receive credit for it.
&lt;/p&gt;

&lt;p&gt;One thing keeps bugging me though. Soon you will release the browser on Windows Update and people will automatically start upgrading, replacing their old browser (IE6) with the new version. I use Windows Update so my version will be upgraded too, and there&#39;s the problem: I&#39;m a web developer and I need to test my sites in more than one version of each browser. IE7&#39;s ability to &lt;em&gt;replace&lt;/em&gt; IE6 instead of working standalone will for me be a pain. As I see it I have the following options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Get another computer&lt;/strong&gt;. On that other computer I could have the old version of IE installed, with security bugs and all, and then move from computer to computer while testing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Install a virtual machine&lt;/strong&gt; on my current computer. This means I could have the old IE6 on the virtual machine and test there. While this sounds pretty good it still means I have a reserve a large part of my computer for IE6 testing, something that feels very strange to me. I looked up what Microsoft Virtual PC costs and found $129, an expence that a student can&#39;t take just like that&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Drop support for IE6&lt;/strong&gt;. If you really could get all your current users to upgrade this would be a viable option. The problem is that you will not, at least for the comming five years. You will have the non-XP Windows users that won&#39;t get the oppurtunity to upgrade, you will have the modem users that will not have the bandwidth to upgrade and you will have the clueless people that will have no idea that there is an upgrade available. This is not a problem for you, because you are just working with the new version, but it is a problem for me as a web developer, because I have to deal with the old version for a long time still.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hack IE7 to work standalone&lt;/strong&gt;. I have found some tutorials on how to make IE7 standalone but the problem with that is that it&#39;s a mess. Look at it, copying of registry entries, DLL files, and EXE files around. If this is what you want us to do, why not ship a nice and thoroughly tested version of this script yourselves?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, this is my dilemma. Which of the options do you want me to use?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Web Development Pack</title>
            <link href="http://friendlybit.com/css/web-development-pack/" rel="alternate" type="text/html" title="Web Development Pack" />
            <published>2006-04-24T17:20:05+02:00</published>
            <updated>2006-04-24T17:20:05+02:00</updated>
            <id>http://friendlybit.com/css/web-development-pack/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">When I move to a new computer, I keep installing the same tools again and again. I always have problems finding them because they are spread out all over...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/web-development-pack/">
                &lt;p class=&#34;first&#34;&gt;
  When I move to a new computer, I keep installing the same tools again and again. I always have problems finding them because they are spread out all over the net. This article is an attempt to gather the links to the important web development tools in one place, as a resource for beginners.
&lt;/p&gt;

&lt;p class=&#34;first&#34;&gt;
  (&lt;strong&gt;Update &lt;/strong&gt;2009-02-16&lt;strong&gt;: &lt;/strong&gt;This is an update to an old article, I can&#39;t have old stuff polluting the site)
&lt;/p&gt;

&lt;h2 id=&#34;browsers-you-need&#34;&gt;Browsers you need&lt;a href=&#34;#browsers-you-need&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For modern web development today it&#39;s important to test in more than one browser. The current best practice is to first test in one that has good support for standards and then move on to the older ones and fix your site for them.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.mozilla.com/firefox/&#34;&gt;Mozilla Firefox&lt;/a&gt;&lt;/strong&gt; is a great browser and a serious challenger to Internet Explorer. The best web development feature of Firefox is all its extensions that are available. I have made a special section about good extensions to use below.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.my-debugbar.com/wiki/IETester/HomePage&#34;&gt;IE Tester&lt;/a&gt;&lt;/strong&gt; helps to test your site in Internet Explorer. It is the browser that is used by most people over the world (because it ships with Windows, not because it’s the best one). The good thing with IE Tester is that it lets you run multiple versions of IE at the same time. No need for virtual machines. Consider hard if you &lt;a href=&#34;/browsers/motivation-for-building-for-ie6/&#34;&gt;need support for IE6&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.apple.com/support/downloads/safari.html&#34;&gt;Safari&lt;/a&gt;&lt;/strong&gt; / &lt;strong&gt;&lt;a href=&#34;http://www.google.com/chrome&#34;&gt;Chrome&lt;/a&gt;&lt;/strong&gt; are two good browsers based on the webkit rendering engine. Webkit&#39;s greatest merit is that it was one of the first browsers to complete the &lt;a href=&#34;http://webstandards.org/action/acid2/guide/&#34;&gt;Acid2 test&lt;/a&gt;. Safari is also very popular on the Mac, so you probably you make sure it works.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.opera.com/download/&#34;&gt;Opera&lt;/a&gt;&lt;/strong&gt; is another good browser with a little fewer users. The Opera team has put great effort to make any standards compliant site work in Opera so there’s no reason why your site shouldn’t work. There’s a few quirks though and it can therefore be worthwhile to test in it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;firefox-extensions&#34;&gt;Firefox extensions&lt;a href=&#34;#firefox-extensions&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Firefox extension system has made it possible for thousands of developers to make little snippets of code that add useful features to Firefox. There are a lot of extensions out there and so I’m sure I’m missing many but here’s the list that I just can’t live without (related to web development):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://getfirebug.com/&#34;&gt;Firebug&lt;/a&gt;&lt;/strong&gt; is the best thing that has happened to front-end development. It lets you click elements in the browser, and shows what HTML and CSS is needed to render the element you clicked. Excellent! Makes everything so much easier. Allows manipulation that is updated in realtime&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://chrispederick.com/work/webdeveloper/&#34;&gt;Web development toolbar&lt;/a&gt;&lt;/strong&gt; is an extension for Firefox that enables all kinds of useful features. It can give you borders around all your elements, it allows you to edit CSS in a sidebar and see the changes instantly, it allows you to remove images just to name a few. I can’t work at all without this one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://users.skynet.be/mgueury/mozilla/&#34;&gt;HTML Validatior&lt;/a&gt;&lt;/strong&gt; is the third must-have extension. It validates pages you visit on the fly, and shows a small red cross in the statusbar if you don&#39;t validate. Great way to quickly discover errors in your HTML.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.colorzilla.com/firefox/&#34;&gt;ColorZilla&lt;/a&gt;&lt;/strong&gt; is extremely useful for finding out HTML color codes from images, something you will do a lot when coding graphic intensive pages.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;other-programs-you-might-need&#34;&gt;Other programs you might need&lt;a href=&#34;#other-programs-you-might-need&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You&#39;re not only going to be surfing to your site, you&#39;re also going to need a program to write your code in, a graphics editor, and a FTP program to send your files off to the server with.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I&#39;ve always had problems finding a text editor that I liked. They either don&#39;t allow me to use the windows shortcuts I&#39;ve learned to love, don&#39;t allow proper color coding of the languages I care about, don&#39;t handle setting up project in an easy enough manner, or handle character encoding badly. So I&#39;ve just resorted to using whatever editor that fits best with the environment I&#39;m currently working in. &lt;strong&gt;&lt;a href=&#34;http://www.netbeans.org/downloads/&#34;&gt;Netbeans&lt;/a&gt;&lt;/strong&gt; for Java, &lt;strong&gt;Visual Studio&lt;/strong&gt; (non-free) for .NET, and &lt;strong&gt;&lt;a href=&#34;http://www.activestate.com/komodo_edit/&#34;&gt;Komodo Edit&lt;/a&gt;&lt;/strong&gt; for Python and PHP.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.macromedia.com/software/fireworks/&#34;&gt;Fireworks&lt;/a&gt;&lt;/strong&gt; (non-free) is a graphics editor that lets me work with both vector and bitmap files. It allows filters that can be easily removed and tweaked without breaking the original. It also has a nice slice feature that let&#39;s me export parts of design mock-ups quickly. There&#39;s no free program worth its name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://filezilla-project.org/&#34;&gt;FileZilla&lt;/a&gt;&lt;/strong&gt; is a good open-source FTP program I keep coming back to. I fire it up and it just works every time. It&#39;s fairly feature-rich but you don&#39;t need to know all of it to get it going. If you do want to play with advanced stuff it&#39;s there. Easy to use, fast, many features.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&#39;s it. All that is left is for you to either agree or disagree.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">What beginners ask for (and what I tell them)</title>
            <link href="http://friendlybit.com/css/what-beginners-ask-for-and-what-i-tell-them/" rel="alternate" type="text/html" title="What beginners ask for (and what I tell them)" />
            <published>2006-03-27T22:22:07+02:00</published>
            <updated>2006-03-27T22:22:07+02:00</updated>
            <id>http://friendlybit.com/css/what-beginners-ask-for-and-what-i-tell-them/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Being in an IRC help channel lets you meet a lot of people. Many are fresh beginners that just wrote their first lines of CSS and stumbled over something...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/what-beginners-ask-for-and-what-i-tell-them/">
                &lt;p&gt;Being in an IRC help channel lets you meet a lot of people. Many are fresh beginners that just wrote their first lines of CSS and stumbled over something they found strange. When you look at their questions from a perspective you quickly find that many of them are repeated and come back over and over again. This article is an attempt to list a few of the important concepts that people seem to have trouble with.&lt;/p&gt;
&lt;h2 id=&#34;separation&#34;&gt;Separation of content and design&lt;a href=&#34;#separation&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Separation is the fundamental idea that CSS builds upon. Ten years ago there was only one way to make pages that worked across browsers: you mixed everything in one large file and copied that file if you wanted pages that looked similar. Then &lt;a href=&#34;/css/interview-why-did-css-succeed/&#34; title=&#34;Interview with Håkon Wium Lie&#34;&gt;Håkon&lt;/a&gt; and Bert came up with CSS and things got much easier. Their idea is to make the code easier to maintain by extracting everything that has to do with design, put it in an external file and link to that file when we want a certain look. CSS is all about design and HTML is all about content and structure.&lt;/p&gt;
&lt;p&gt;Even though this sounds good in theory there are a lot of cases where it&#39;s hard to determine whether something is design or not. Is the company logo design or content? When you start thinking about those kinds of problems you know you&#39;re on the right track. You can find a couple of examples of the separation I&#39;m talking about in my &lt;a href=&#34;/css/beginners-guide-to-css-and-standards/&#34;&gt;beginners guide&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;clearing&#34;&gt;Clearing floats&lt;a href=&#34;#clearing&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Floats and clearing is another problem almost everyone has in the beginning. What I like to use when I explain how floats work is the old align-attribute on images. Long time ago, when you only could use HTML for design, and wanted the text to &amp;quot;flow around the image&amp;quot; you used:&lt;/p&gt;
&lt;div class=&#34;incorrect&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;/files/post-media/image.jpg&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;align&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;right&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The above code is clearly design (placement of the image) so we should use CSS instead of HTML for this.&lt;/p&gt;
&lt;div class=&#34;correct&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;id_of_image&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;CSS is not restricted to float only images, all elements can be floated. This opens up to both new layout methods and confusion. To place three divisions side by side, just give them a width and float them. You can see a layout based on this in my &lt;a href=&#34;/css/simple-css-templates/&#34;&gt;article about layouts&lt;/a&gt; or the &lt;a href=&#34;/files/templates/?style=3columns_float_float_float&amp;cols=3&#34; data-no-instant&gt;3-column example&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Clear&lt;/em&gt; is also important to know of. Setting &lt;code&gt;clear: both;&lt;/code&gt; on an element makes it move downwards until it&#39;s below all previous floats. That was how the footer in the above example was made.&lt;/p&gt;
&lt;p&gt;Floats and clears are not always easy to understand though. One thing people often ask about is what&#39;s wrong when their container isn&#39;t expanded to contain everything inside it. Eric Meyer excellently explains both that problem and its solution in the article &lt;a href=&#34;http://www.complexspiral.com/publications/containing-floats/&#34;&gt;Containing Floats&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;validation&#34;&gt;Validation is a timesaver&lt;a href=&#34;#validation&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Why is validation so important? Because I just can&#39;t stand you forgetting your alt attributes? Because I think that valid pages are better than non-valid? No and No. It&#39;s because validation finds the simple errors. If I misspell width or some other property a validation will find it. If I nest my tags incorrectly a validation will find it. If I forget to close a quote in a link? A validation will find it. Validation is a great timesaver because it actually finds all the small errors that humans have trouble finding. To make validation even easier I use the &lt;a href=&#34;http://users.skynet.be/mgueury/mozilla/&#34;&gt;Html Validator extension&lt;/a&gt; for Firefox. A little icon in the bottom right corner tells me when I have an HTML error. Validation is a great tool, use it.&lt;/p&gt;
&lt;h2 id=&#34;accessibility&#34;&gt;Accessibility is not about blind users&lt;a href=&#34;#accessibility&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It could be that I&#39;m trying to explain why someone should add labels to their form. I say something in the lines of:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Me&lt;/strong&gt;: &amp;quot;Not having labels hurts your site’s accessibility&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;User&lt;/strong&gt;: &amp;quot;But I don&#39;t have any blind users on my site!&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Accessibility is about making it easy for as many as possible to access your content. With, often simple, means you can make it much easier for people to access your site. Let me give you some examples or people your can help by thinking about accessibiliy.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
  &lt;th&gt;User&lt;/th&gt;
  &lt;th&gt;How you can help&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
  &lt;td&gt;Partly color blind&lt;/td&gt;
  &lt;td&gt;Don&#39;t use only color to convey information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;People unable to use a mouse. Either because of some physical disability or simply that they are linux hackers and dislike it.&lt;/td&gt;
  &lt;td&gt;Make sure keyboard navigation works as intended&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;Young users or users with another native language than yours&lt;/td&gt;
  &lt;td&gt;Don&#39;t overcomplicate your text&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;People with a slow connection&lt;/td&gt;
  &lt;td&gt;Mind the size of your site&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The list could continue for a whole article. People from those groups would very much like to see your site and buy your stuff just like anyone else. Read up on the basics of accessiblity, it helps a lot of people. Robert Johansson has written a nice article about how you could &lt;a href=&#34;http://www.456bereastreet.com/archive/200603/evaluating_website_accessibility_part_1_background_and_preparation/&#34;&gt;evaluate your website&#39;s accessibility&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;harder&#34;&gt;Some things are harder to do with CSS, that does not mean CSS is a bad language&lt;a href=&#34;#harder&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;People that are switching from tables to CSS often complain about what a bad language CSS is for not supporting &lt;em&gt;[insert favourite feature]&lt;/em&gt;. I did so too in the beginning. What makes me like the language is all the other powers it gives me. It is not possible to do everything as easily with CSS as it is with tables. But other things are much easier, and some things aren&#39;t even possible with tables. There are good parts and bad parts and to me the good parts greatly outweigh the bad ones.&lt;/p&gt;
&lt;h2 id=&#34;equal&#34;&gt;Equal height columns&lt;a href=&#34;#equal&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The last thing I&#39;m going to talk about in this article is equal height columns. The problem is that your have two or three columns of content that stretch down the page. You want the columns to stretch as far as the longest column but the content inside does not expand the columns that far.&lt;/p&gt;
&lt;p&gt;This problem is most easily solved by a technique known as &lt;em&gt;faux columns&lt;/em&gt;. Add a container to the columns you have and then add a background image to that container. The image will repeat down that page and make it look like your columns take up exactly as much vertical space. I&#39;ve added a &lt;a href=&#34;/files/templates/?style=faux_columns&amp;cols=3&amp;nofooter=1&#34; data-no-instant&gt;faux column example&lt;/a&gt; for you to look at.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Challenge: What’s the worst you can do?</title>
            <link href="http://friendlybit.com/css/challange-whats-the-worst-you-can-do/" rel="alternate" type="text/html" title="Challenge: What’s the worst you can do?" />
            <published>2006-03-11T16:09:26+01:00</published>
            <updated>2006-03-11T16:09:26+01:00</updated>
            <id>http://friendlybit.com/css/challange-whats-the-worst-you-can-do/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">After reading through the comments on my levels of CSS article I find that I few people seem to think that the article is a way to ridicule beginners. It&#39;s...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/challange-whats-the-worst-you-can-do/">
                &lt;p&gt;After reading through the comments on my &lt;a href=&#34;/css/levels-of-css-knowledge/&#34;&gt;levels of CSS&lt;/a&gt; article I find that I few people seem to think that the article is a way to ridicule beginners. It&#39;s not. It&#39;s a way to document the steps that I think I have climbed. Some people also thought that this set of levels is a good indicator of how good sites you will make. That&#39;s also false. Being Level 5 or 6 in the list means that you are a good &lt;em&gt;coder&lt;/em&gt;, nothing else. It does not mean that a site you make is any good, I&#39;ve seen many sites that have great code but that still makes me want to kill someone. Don&#39;t confuse good web developers with good coders. &amp;quot;Don&#39;t be a &lt;a href=&#34;http://www.molly.com/2006/02/23/how-to-sniff-out-a-rotten-standardista/&#34;&gt;rotten standardista&lt;/a&gt;&amp;quot; as Molly Holzschlag would put it.&lt;/p&gt;
&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;a href=&#34;#the-challenge&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To give you a perspective of how bad it really could be I&#39;m challenging all the readers of Friendly Bit. It&#39;s kind of a competition (with no prize) about who can make the worst site. The rules are simple; you are to construct a page, using HTML and CSS (and Javascript if you think you need it) that has a design that is as hideous as possible. I want pages that make my eyes bleed, that make small children cry and makes &lt;a href=&#34;http://maddox.xmission.com/&#34;&gt;Maddox&lt;/a&gt; write hate articles about you. Think of all the good things you&#39;ve learnt and do the opposite.&lt;/p&gt;
&lt;h2 id=&#34;inspiration-for-a-truly-hideous-design&#34;&gt;Inspiration for a truly hideous design&lt;a href=&#34;#inspiration-for-a-truly-hideous-design&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I won&#39;t be giving out any prize but what I can do is help you with some ideas of bad code.&lt;/p&gt;
&lt;p&gt;Make use of the &lt;code&gt;&amp;lt;marquee&amp;gt;&lt;/code&gt; tag. It makes any content inside it scroll in the speed and direction you choose. Did you know that you can wrap &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; in a marquee tag? That&#39;s right, your entire page will move automatically. You can also nest several marquee tags inside each other. Ohh yeah!&lt;/p&gt;
&lt;p&gt;Another good tag you can use is the &lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tag. Can it be applied to, say, a table? I hear you ask. But of course. You can have a full screen blinking table on your company homepage.&lt;/p&gt;
&lt;p&gt;Continuing with the good ideas we have the oldschool &lt;em&gt;frames&lt;/em&gt; we all have come to like. Did you know that there are no set upper limit on the number of frames you can load? You can have thousands of them! You can even mark up a whole tabular grid with frames alone.&lt;/p&gt;
&lt;p&gt;This challange is about &lt;em&gt;terrible code&lt;/em&gt; as much as it&#39;s about terrible design. So don&#39;t go with well-formed or the basic foundations of HTML. Did you even try putting tags inside other tags? &lt;code&gt;&amp;lt;font &amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt; size=&amp;quot;3&amp;quot;&amp;gt;&lt;/code&gt; is quite fantastic don&#39;t you think? Make your page upside down by adding the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; below the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;, but only after you have added your own &lt;code&gt;&amp;lt;neck&amp;gt;&lt;/code&gt; tag to the mix. Surprise me!&lt;/p&gt;
&lt;h2 id=&#34;how-to-accept-the-challenge&#34;&gt;How to accept the challenge&lt;a href=&#34;#how-to-accept-the-challenge&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To join all of this you just have to make the page, put it up on your server and link to it here. Post a link as a comment or simply trackback (link to this post) from your own blog and it will show up here.&lt;/p&gt;
&lt;p&gt;Finally: Don&#39;t forget the lesson behind all this. When you see a site with bad code, know that there&#39;s a lot of much worse sites out there.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Interview: Why did CSS succeed?</title>
            <link href="http://friendlybit.com/css/interview-why-did-css-succeed/" rel="alternate" type="text/html" title="Interview: Why did CSS succeed?" />
            <published>2006-03-02T12:14:22+01:00</published>
            <updated>2006-03-02T12:14:22+01:00</updated>
            <id>http://friendlybit.com/css/interview-why-did-css-succeed/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">When you are looking to reach the upper skill levels of a technique it&#39;s always a good idea to start with looking back. The history often says much about...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/interview-why-did-css-succeed/">
                &lt;p&gt;When you are looking to reach the upper skill levels of a technique it&#39;s always a good idea to start with looking back. The history often says much about the fundamental building blocks and why they work like they do. What were the basic driving forces behind it? What need did it fill? When examining those kinds of questions you can get a far deeper knowledge of what you are working with.&lt;/p&gt;
&lt;p&gt;In an attempt to gain some of that knowledge I contacted the authors of &lt;a href=&#34;http://www.w3.org/TR/REC-CSS1-961217&#34;&gt;Cascading Style Sheets, level 1&lt;/a&gt; (CSS1, notice the nice background image) and asked a few questions about the development on the first CSS specification.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://people.opera.com/howcome/&#34;&gt;Håkon Wium Lie&lt;/a&gt; promptly answered my questions. He&#39;s currently the CTO of Opera, making one of the better browsers out there. This was done by email so don&#39;t be surprised if earlier answers reference later ones :) Here&#39;s the interview:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Emil Stenström:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;First I&#39;d like to extend a big thank you from the web development community for coming up with the fantastic idea that is CSS. The language has become a huge success and thousands of people daily exchange ideas of how to best use its power CSS. New people also learn the language each day and big corporations rebuild their sites because of it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Håkon Wium Lie:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your kind words. As we&#39;ll get back to later in the interview, CSS is the result of many people&#39;s ideas and efforts. Without a strong community around CSS, the specification would not have succeeded.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Emil Stenström:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1994 when CSS where first proposed there were many different languages available that also made it possible to style web pages. What arguments where there that made people choose CSS instead of any of the others?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Håkon Wium Lie:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There were, indeed, a bunch of proposals on the table. First, there were the style sheet languages that had been developed before the web. FOSI, DSSSL, and &amp;quot;P&amp;quot; should be mentioned. Second, there were around ten different style sheet proposals for the web. Several of them were based on earlier languages, but most of them brought new ideas to the table. There was also a healthy interchange of ideas and CSS picked up its shares.&lt;/p&gt;
&lt;p&gt;In the end, I think CSS succeeded because it took the web — as opposed to a paper-centric publishing model — seriously. The web introduced some new requirements for style sheet languages, including progressive rendering, screen-based formatting (e.g., pixel units), media-specific style sheets, link styling, and a certain robustness in case one resource (e.g., the style sheet itself) is missing.&lt;/p&gt;
&lt;p&gt;It so happens that I&#39;m about to defend my PhD thesis on this subject. So, if you&#39;re interested in the history of style sheet languages in the context of the web, I can offer you a few hundred pages to read.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://people.opera.com/howcome/2006/phd&#34;&gt;http://people.opera.com/howcome/2006/phd&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Emil Stenström:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I can imagine that getting the language from the idea stage to it being accepted by the W3C as a recommendation was anything but a walk in the park. There where surely other authors that wanted their language to succeed instead. How much did work did you put in to promoting the language? Did the features it contain work in promoting the language in itself?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Håkon Wium Lie:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Most of the ten proposals I mentioned above were not serious contenders. The one proposal that had the most backing, beside CSS, was DSSSL-Lite. Many people in the SGML camp were upset when W3C (on March 5, 1996) announced that &lt;q&gt;The style sheet efforts will be based on Håkon Lie&#39;s Cascading Style Sheets (CSS) initiative, to be further refined by a group of experts within the W3C.&lt;/q&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.w3.org/Style/960305_News.html&#34;&gt;http://www.w3.org/Style/960305_News.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One important reason for W3C promoting CSS was support from implementors. Microsoft, amongst others, had committed to implementing CSS at a Style Sheet workshop held in 1995. Compared to DSSSL-Lite, CSS was easier to support since it wasn&#39;t Turing-complete and didn&#39;t require a transformation step. So, in a way, it was the simplicity — the &lt;strong&gt;lack&lt;/strong&gt; of features — that won people over.&lt;/p&gt;
&lt;p&gt;The fact that Microsoft haven’t followed up on their promises of supporting CSS and other web standards is very sad. I proposed the Acid2 test to support them along the way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://news.com.com/The+Acid2+challenge+to+Microsoft/2010-1032_3-5618723.html?tag=nefd.ac&#34;&gt;The Acid2 challenge to Microsoft&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.webstandards.org/acid2&#34;&gt;http://www.webstandards.org/acid2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Emil Stenström:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;CSS got accepted as a recommendation and browsers started to implement the language. This was the real test to see if the specifications where clear enough. Are there sections or parts of the first specification that you wish that you had written differently or emphasized more?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Håkon Wium Lie:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;All in all, I&#39;m very happy with how CSS1 has stood the test of time. Compared to many other standards, there are few ugly compromises and not much feature creep. Looking back, I probably would have argued to drop a few features that havn&#39;t seen much use (first-letter and first-line), and I would have split a few overloaded properties (&#39;display&#39; and &#39;white-space&#39; come to mind).&lt;/p&gt;
&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;I CSS2, I think we should have seen the rise of JavaScript as an opportunity rather than a threat. A &#39;style sheet object model&#39; should have been built into the thing rather than being an afterthought.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Emil Stenström:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Many people shift between thinking about CSS as something written by a few people, perhaps even only the two of you, and it being written by an organization of thousands of people. Which of those are closest to the truth? How many are approximately involved in the writing of a specification (ie. CSS 2)?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Håkon Wium Lie:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Lots of people have to be involved. Otherwise, a specification is likely to die a lonely death. In the beginning, however, it&#39;s better to be only a few people in order to establish a foundation quickly. For CSS, that happened in the summer of 1995 when Bert Bos and I worked intensely around a white board for a few weeks. He came up with many key ideas, including the forward-compatible parsing.&lt;/p&gt;
&lt;p&gt;After that, CSS became a work item of the W3C&#39;s HTML working group before getting a working group of its own in 1997. CSS2 came out of that working group. I would estimate that around 10-15 people were actively involved in working out the design of CSS2, while four people are listed as &amp;quot;editors&amp;quot;. CSS1 didn&#39;t have &amp;quot;editors&amp;quot;, it had &amp;quot;authors&amp;quot;.&lt;/p&gt;
&lt;p&gt;Also, there was a strong community of users on the www-style mailing list that helped us shape the specification, write test suites, and complain in all the right places and do all the other things that are necessary to make a web standard succeed. The real work starts when the specification is finished…&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Emil Stenström:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Attribute selectors and generated text where available in one of the early browsers, Argo, over 10 years ago. Those features were not included in the first spec but instead moved to CSS 2. Why were they moved and do you have any ideas of why they are still not implemented by some browsers? Do you have any ideas of things we could do to get implementations available faster in the different browsers?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Håkon Wium Lie:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Generated content is very cool and it&#39;s sad to see that Microsoft&#39;s IE7 — coming out 8 years after CSS2 became a Recommendation — will not support it. This is remarkable since Dean Edwards has added support for generated content in his &amp;quot;IE7&amp;quot; project; by adding a link to a JavaScript on our page, IE will happily display CSS2 generated content. So, I believe the decision not to fully support CSS in IE is political rather than technical. Thankfully, there are some other browsers around. May I mention Opera, here?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.opera.com/&#34;&gt;http://www.opera.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Emil Stenström:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Talking more about the future of CSS, there is much work going on with the CSS 3 spec. We will see text shadows, gradients, and multi column layouts, just to name a few. Which new features are to most exciting to you? Is there anything that isn&#39;t in the spec yet but will soon be that you want to tell us about?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Håkon Wium Lie:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Personally, I&#39;m very exited about the print-related features. Being able to write our book in HTML and style it with CSS was great fun and confirmed our belief in CSS beyond screen use. It required a few features not present in CSS2 and they will be described in CSS3.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.alistapart.com/articles/boom&#34;&gt;http://www.alistapart.com/articles/boom&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Just like I got involved with Opera to ensure that someone implemented CSS correctly, I’m now also involved with Prince to ensure that someone gets CSS printing right.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.princexml.com&#34;&gt;http://www.princexml.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Emil Stenström:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Thanks again for taking the time to answer these questions. Perhaps some of my readers will be the ones coming up with the next big thing™.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Håkon Wium Lie:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Min-width for IE revisited</title>
            <link href="http://friendlybit.com/css/min-width-for-ie-revisited/" rel="alternate" type="text/html" title="Min-width for IE revisited" />
            <published>2006-02-22T21:41:56+01:00</published>
            <updated>2006-02-22T21:41:56+01:00</updated>
            <id>http://friendlybit.com/css/min-width-for-ie-revisited/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Much has been written over the years of how to get min-width to work in Internet Explorer (IE). Min-width works almost like width but it only sets a lower...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/min-width-for-ie-revisited/">
                &lt;p&gt;Much has been written over the years of how to get min-width to work in Internet Explorer (IE). Min-width works almost like width but it only sets a lower bound on the width (&amp;quot;You can&#39;t get any narrower than this!&amp;quot;). Very useful when building layouts that are supposed to work on many screen resolutions. This article is a remake of Stu Nicholls variant but removing most of the divs he uses. &lt;a href=&#34;/files/minwidth_for_IE/&#34; data-no-instant&gt;An example is availiable&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;if-all-browsers-supported-standards&#34;&gt;If all browsers supported standards&lt;a href=&#34;#if-all-browsers-supported-standards&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The question that triggered this article was someone that wanted the page to be 90% wide but no less than 500px. For those of you that know CSS2 you know that this can be done by simply setting:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;element&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;90&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;min-width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;500&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Since no versions of IE support the min-width property we will have to try something else.&lt;/p&gt;
&lt;h2 id=&#34;what-has-been-done-before&#34;&gt;What has been done before?&lt;a href=&#34;#what-has-been-done-before&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To solve this problem there has been suggestions of all sorts of things: &lt;a href=&#34;http://www.doxdesk.com/software/js/minmax.html&#34;&gt;Javascript&lt;/a&gt;, Proprietary CSS expressions, One that doesn&#39;t handle both width and min-width, and &lt;a href=&#34;http://www.webreference.com/programming/min-width/&#34;&gt;One using four (!) extra divs&lt;/a&gt;. When looking at the different solutions I quickly came to the conclusion that I didn&#39;t want to use javascript. It would be better if it could be accomplished using CSS only. That rules out the two first versions. Dave Shea&#39;s does not handle both width and min-width. The last one uses a lot of divs, are really all of them needed?&lt;/p&gt;
&lt;p&gt;Stu&#39;s solution is set to work in IE 5, an old outdated browser and by removing the code to make it work for that one we will be able to lose some of the code.&lt;/p&gt;
&lt;p&gt;IE5 has a broken &lt;a href=&#34;http://www.brainjar.com/css/positioning/&#34;&gt;box model&lt;/a&gt;, so you can&#39;t set both margin/border/padding and a width on the same container and get consistent behaviour across browsers. I know of two ways to sidestep that bug: The first one is using the ugly &lt;a href=&#34;http://www.tantek.com/CSS/Examples/boxmodelhack.html&#34;&gt;box model hack&lt;/a&gt; which incorporates a parsing bug in how IE 5 handles the voice-family property. The other way is to use two containers and set the width on one of them and the margin/border/padding on the other. Stu uses the latter variant and therefore has two unnecessary divs. Two down, and counting!&lt;/p&gt;
&lt;p&gt;Next up we can use the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag just like if it was a div, setting the width and min-width on that one. Another div bites the dust. If we can handle using a solid background color another one can be left out.&lt;/p&gt;
&lt;p&gt;With everything summed up we can get &lt;a href=&#34;/files/minwidth_for_IE/&#34; data-no-instant&gt;min-width for IE on any container using only one extra div&lt;/a&gt;. This works under the constraint that we don&#39;t support IE 5 and that we can handle a single color background. I hope that helps someone out there.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Extra fluid layouts with javascript</title>
            <link href="http://friendlybit.com/css/extra-fluid-layouts-with-javascript/" rel="alternate" type="text/html" title="Extra fluid layouts with javascript" />
            <published>2006-02-13T01:00:31+01:00</published>
            <updated>2006-02-13T01:00:31+01:00</updated>
            <id>http://friendlybit.com/css/extra-fluid-layouts-with-javascript/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">I&#39;m a big fan of vector graphics. Because of that I love Macromedia Fireworks and the way it handles all elements like vectors. The good thing about that is...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/extra-fluid-layouts-with-javascript/">
                &lt;p&gt;I&#39;m a big fan of vector graphics. Because of that I love Macromedia Fireworks and the way it handles all elements like vectors. The good thing about that is that they can be resized and zoomed without them losing their sharpness.&lt;/p&gt;
&lt;p&gt;This got me thinking about how to add some vectorization to CSS layouts. My idea was that you should let the width of the screen decide the font-size of, for example, your headers. This could make for nice fluid layouts and might even add to usability in some cases. There are probably other uses for this but I leave that to you, please use the comments if you come up with something.&lt;/p&gt;
&lt;p&gt;Start by having a look at the &lt;a href=&#34;/files/window_fontsize/&#34; data-no-instant&gt;dynamic font-size example&lt;/a&gt; just so we&#39;re talking about the same thing. Try resizing the window and reloading and see that the headers really do adapt to the width of the browser window.&lt;/p&gt;
&lt;h2 id=&#34;how-its-done&#34;&gt;How it&#39;s done&lt;a href=&#34;#how-its-done&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;First we need a way to meassure the width of the text in the default font. For this I use my own little getTextWidth() that were constructed in my &lt;a href=&#34;/css/line-breaking-with-javascript/&#34;&gt;line-break script&lt;/a&gt;. It simply takes a piece of text, attaches it to the page, meassures it&#39;s width and removes it again.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;JS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getTextWidth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;createElement&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;span&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;innerHTML&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;appendChild&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;len&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;offsetWidth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;removeChild&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;len&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Ok, now we know the width of some text in it&#39;s non formated state. Next up is to scale it as much as needed.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;JS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;scaleUp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;elem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;targetWidth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;blockWidth&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getTextWidth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;elem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;innerHTML&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;defaultSize&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;parseInt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;elem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;fontSize&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;||&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;100%&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;newSize&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;Math&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;floor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0.9&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;targetWidth&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;blockWidth&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;defaultSize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;elem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;fontSize&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;newSize&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;%&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you see scaleUp() determines a percentage by looking at three things: it&#39;s unformated width, it&#39;s current width and the target width. Font-size and text width does not seem to follow eachother perfectly so an additional multiplication by 0.9 is needed.&lt;/p&gt;
&lt;p&gt;This handy little function is then called with the element you want to scale and the width in pixels of how wide you want it. The calls look something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;JS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;element&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;h1&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)[&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;offsetWidth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;nx&#34;&gt;scaleUp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;element&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&#39;s it, hope you find some fun use for it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; After doing some research I see that Eric Meyer is already using something like this in his &lt;a href=&#34;http://www.meyerweb.com/eric/tools/s5/&#34;&gt;slideshow system S5&lt;/a&gt;. Well well, it was a funny exercise none the less.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Frames or Iframes with CSS</title>
            <link href="http://friendlybit.com/css/frames-or-iframes-with-css/" rel="alternate" type="text/html" title="Frames or Iframes with CSS" />
            <published>2006-02-01T23:50:59+01:00</published>
            <updated>2006-02-01T23:50:59+01:00</updated>
            <id>http://friendlybit.com/css/frames-or-iframes-with-css/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">A frequent request from people new to CSS is trying to get a behaviour similar to frames while only using CSS. Many have read that frames have a lot of...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/frames-or-iframes-with-css/">
                &lt;p&gt;A frequent request from people new to CSS is trying to get a behaviour similar to frames while only using CSS. Many have read that frames have a lot of problems but do not know much more than that. This article will try to explain why frames are bad and what to do about it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#why&#34;&gt;Why are traditional frames such a bad thing?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#scrollbar&#34;&gt;Getting a scrollbar on any element using CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#traditional&#34;&gt;Mimicking traditional frames&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: I&#39;ve updated this technique &lt;a href=&#34;/css/position-fixed-css-templates/&#34;&gt;using position: fixed in a new article&lt;/a&gt;, have a look at those templates instead! (Although this article is still good for background information).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&#34;why&#34;&gt;Why are traditional frames such a bad thing?&lt;a href=&#34;#why&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let me start by just listing a few bad things about frames.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Prevents users from bookmarking&lt;/strong&gt; the exact page they&#39;re on. Instead the bookmark will lead to the frameset. This is clearly not a good choice for larger sites where finding a certain page might be a problem, but even users on smaller sites might find it annoying. I do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Poor support by some parsers&lt;/strong&gt; leads to problems. Many screen readers, mobile phones, and search engines have problems parsing frames. This means some of your users might miss out on your content.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Content order&lt;/strong&gt; problems. Just like with tables, frames give screen readers problems when deciding which order to read the frames. If it reads a 2×2 frameset will not know whether to read the content like two rows or like two columns. The order might be important for understanding the content and frames has nothing built-in to help with that.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Search engines&lt;/strong&gt; might split the ranking up on the different pages. I just discovered this by looking at one of my old pages (no, I won&#39;t show it, it&#39;s terrible :). There, the &lt;a href=&#34;http://www.webworkshop.net/pagerank.html&#34;&gt;PageRank&lt;/a&gt; has been split up on the framed pages and the frameset has no rank whatsoever.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Invalid code&lt;/strong&gt;. If you&#39;re using separate frames for navigation and content your links will need the &lt;code&gt;target&lt;/code&gt; attribute to make links from the navigation frame open in the content frame. That attribute is not supported when using a strict doctype so you will have to use transitional. The doctype won&#39;t matter if you want to get rid of borders cross-browser though, to do that you need invalid markup.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Printing is a problem&lt;/strong&gt;. How should the different frames be handled while printing? There&#39;s no good solution to this.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;People that are good with javascript sometimes say they like frames because they make it possible to save information about the user even though the user clicks links. A variable can be saved in a frame and be accessible to the other frames even after they are reloaded. Another pro-frames reason frequently heard is that it saves overhead since not the entire page gets reloaded.&lt;/p&gt;
&lt;p&gt;Personally I think that the first is a bad reason to use frames. Using server side scripting to save session info is much more robust since that will mean the applications still work if the user reloads the page. The other reason of only reloading a part of the page is nowadays done by using javascript together with XMLHttp (some like to call it AJAX). To me, the bad parts of frames greatly weigh over, even for applications.&lt;/p&gt;
&lt;h2 id=&#34;scrollbar&#34;&gt;Getting a scrollbar on any element using CSS&lt;a href=&#34;#scrollbar&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Aside from all of the above frames are not structure. Think about it. When working with frames you define that you want a couple of rows and columns, which should scroll and which shouldn&#39;t, and which should have borders. These are things that many of us would never dream of doing with tables but some still use frames like that.&lt;/p&gt;
&lt;p&gt;Instead we should define that kind of design in our CSS files. How? By using a few lines of code you can easily limit any element to a certain width/height and let it scroll if the content overflows that size.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Here&amp;#39;s some sample content that I would like to scroll&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;200&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;80&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;overflow&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;auto&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It&#39;s easy, you&#39;re saying: &amp;quot;limit the paragraph to this size and give the box a scrollbar if the content gets too big&amp;quot; (Other valid values for overflow are &amp;quot;hidden&amp;quot; and &amp;quot;scroll&amp;quot;. The former just cuts everything that sticks out, that latter adds the scrollbars even if they&#39;re not needed).&lt;/p&gt;
&lt;p&gt;The above method works when you want something that&#39;s similar to iframes but it doesn&#39;t work right away for traditional frames. Those usually span the whole width or height of the page and leave the rest of the page scrolling. But what stops us from taking any element and stretching and placing it like a frame? Nothing. Let&#39;s do it.&lt;/p&gt;
&lt;h2 id=&#34;traditional&#34;&gt;Mimicking traditional frames&lt;a href=&#34;#traditional&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/files/frames/columns.html&#34; data-no-instant&gt;Two columns with left fixed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/files/frames/columns_navright.html&#34; data-no-instant&gt;Two columns with right fixed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/files/frames/rows.html&#34; data-no-instant&gt;Two rows with a fixed top&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The idea here is to use divisions to group our content. Then position those divisions as if they where frames and limit their site and set &lt;code&gt;overflow: auto&lt;/code&gt; like we did above. Frames use the syntax &lt;code&gt;cols=&amp;quot;200,*&amp;quot;&lt;/code&gt; to say that the first column should be 200px wide and the second one &amp;quot;cover what&#39;s left&amp;quot;. The second part is a bit harder to do with CSS.&lt;/p&gt;
&lt;p&gt;There&#39;s no way to say 100%-200px but there&#39;s a trick we can use: floats push the content away. So if we set a width on the left block to 200px and float it left, the other block will be as wide as possible (default for block level elements) but it&#39;s content will be pushed 200px to the right. Here&#39;s an example of &lt;a href=&#34;/files/frames/columns.html&#34; data-no-instant&gt;two columns with a fixed left&lt;/a&gt; in action. By just changing float: left; on navigation to float: right; we get the other example: &lt;a href=&#34;/files/frames/columns_navright.html&#34; data-no-instant&gt;Two columns with the right one fixed&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;(Technical note: we don&#39;t need to add any margin-left since &lt;a href=&#34;http://www.mezzoblue.com/archives/2005/03/03/clearance/&#34;&gt;overflow: auto; clears&lt;/a&gt; too).&lt;/p&gt;
&lt;p&gt;The above works well for columns but what if we need rows instead? When using frames we specify &lt;code&gt;rows=&amp;quot;100,*&amp;quot;&lt;/code&gt; and as I said this is not possible directly with CSS. We can&#39;t use the above trick either since we&#39;re dealing with height here. Setting &lt;code&gt;height: 100%&lt;/code&gt; will just make it as high as the window, leaving no space for the other row. The solution here is to cheat a bit. If we make the first column 100px high and the lower one 100% high but then remove the first one from the flow we will be pretty close. The first row will be on top of the other one but that can easily be solved by adding a padding-top the same height as the first row.&lt;/p&gt;
&lt;p&gt;We&#39;re almost there now, one last thing: the latter row scrolls on top of the first one because of the order in the source (latter elements stack on top of earlier ones). So what we do is force the first one on top with position: relative. This solves the problem except that it also covers the scrollbar now. An easy (and ugly fix) is to add a margin-left of 16px to the top column making the scrollbar visible again. Browsers seem to use the same scrollbar width so that&#39;s it, an &lt;a href=&#34;/files/frames/rows.html&#34; data-no-instant&gt;example of frame rows&lt;/a&gt; using CSS.&lt;/p&gt;
&lt;p&gt;I&#39;ve tested this in IE 6, FF 1.5 and Opera 8.5 on WinXP and it seems to work fine. Broken in any other browsers? Let me know through the comments.&lt;/p&gt;
&lt;p&gt;When looking at this I see that this is also a good way to mimick blocks that are &lt;code&gt;position: fixed&lt;/code&gt;, something that doesn&#39;t work in IE. This method might be good in a situation where you need that one.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Building a poker template</title>
            <link href="http://friendlybit.com/css/semantic-poker-template/" rel="alternate" type="text/html" title="Building a poker template" />
            <published>2006-01-23T03:31:06+01:00</published>
            <updated>2006-01-23T03:31:06+01:00</updated>
            <id>http://friendlybit.com/css/semantic-poker-template/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">This is the first article in a series of niche templates I&#39;m building. You can have a look at the finished template before we start if you want. About the...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/semantic-poker-template/">
                &lt;p&gt;This is the first article in a series of &lt;a href=&#34;/css/building-niche-sites-with-standards/&#34;&gt;niche templates&lt;/a&gt; I&#39;m building. You can have a look at the &lt;a href=&#34;/files/poker/?style=positioning&amp;style2=decoration&#34; data-no-instant&gt;finished template&lt;/a&gt; before we start if you want.&lt;/p&gt;
&lt;h2 id=&#34;about-the-niche&#34;&gt;About the niche&lt;a href=&#34;#about-the-niche&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Today&#39;s topic is &lt;em&gt;Poker sites&lt;/em&gt;. Poker, and card games overall, are hot these days and they are all over news. There are TV commercials for big international gambling sites even here in Sweden. Being in that kind of spotlight and receiving massive traffic must make those sites better than the rest, don&#39;t you think? Let&#39;s &lt;a href=&#34;http://www.google.com/search?q=poker&#34;&gt;google for &amp;quot;poker&amp;quot;&lt;/a&gt; and have a look at the top 10 results (23 Jan 2006).&lt;/p&gt;
&lt;table summary=&#34;A look at the web standards compliance of poker sites&#34;&gt;
  &lt;tr&gt;
    &lt;th title=&#34;Placement in Google&#34;&gt;
      #
    &lt;/th&gt;
    &lt;th&gt;
      Site name
    &lt;/th&gt;
    &lt;th&gt;
      Doctype
    &lt;/th&gt;
    &lt;th&gt;
      Validation errors
    &lt;/th&gt;
    &lt;th&gt;
      Layout method
    &lt;/th&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;th&gt;
      1
    &lt;/th&gt;
    &lt;td&gt;
      Pokerroom.com
    &lt;/td&gt;
    &lt;td class=&#34;almost&#34;&gt;
      Transitional
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      22 errors
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      Tables
    &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;th&gt;
      2
    &lt;/th&gt;
    &lt;td&gt;
      Poker.com
    &lt;/td&gt;
    &lt;td class=&#34;correct&#34;&gt;
      Strict
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      62 errors
    &lt;/td&gt;
    &lt;td class=&#34;correct&#34;&gt;
      CSS
    &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;th&gt;
      3
    &lt;/th&gt;
    &lt;td&gt;
      Pokerstars.com
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      None
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      48 errors
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      Tables
    &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;th&gt;
      4
    &lt;/th&gt;
    &lt;td&gt;
      Pokerpages.com
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      None
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      336 errors
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      Tables
    &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;th&gt;
      5
    &lt;/th&gt;
    &lt;td&gt;
      Pagat.com Poker
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      None
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      52 errors*
    &lt;/td&gt;
    &lt;td class=&#34;correct&#34;&gt;
      None
    &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;th&gt;
      6
    &lt;/th&gt;
    &lt;td&gt;
      Worldpokertour.com
    &lt;/td&gt;
    &lt;td class=&#34;almost&#34;&gt;
      Transitional
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      56 errors
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      Tables
    &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;th&gt;
      7
    &lt;/th&gt;
    &lt;td&gt;
      Pacificpoker.com
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      None
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      72 errors
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      Tables
    &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;th&gt;
      8
    &lt;/th&gt;
    &lt;td&gt;
      Partypoker.com
    &lt;/td&gt;
    &lt;td class=&#34;almost&#34;&gt;
      Transitional
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      22 errors*
    &lt;/td&gt;
    &lt;td class=&#34;correct&#34;&gt;
      CSS
    &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;th&gt;
      9
    &lt;/th&gt;
    &lt;td&gt;
      Paradisepoker.com
    &lt;/td&gt;
    &lt;td class=&#34;almost&#34;&gt;
      Transitional
    &lt;/td&gt;
    &lt;td class=&#34;almost&#34;&gt;
      1 error
    &lt;/td&gt;
    &lt;td class=&#34;correct&#34;&gt;
      CSS
    &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;th&gt;
      10
    &lt;/th&gt;
    &lt;td&gt;
      Homepoker.com
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      Broken
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      146 errors
    &lt;/td&gt;
    &lt;td class=&#34;incorrect&#34;&gt;
      Tables
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

&lt;p class=&#34;first&#34;&gt;
  *) These sites required that we set a character set manually to even see how many errors there were.
&lt;/p&gt;

&lt;p&gt;What do we see up there? Poker.com and Paradisepoker.com do pretty well. Poker.com uses Strict doctype which means that their validation is stricter than the others, but 62 errors is still too much. Paradisepoker.com almost validates as Transitional which is a good thing compared to the other sites in the list.&lt;/p&gt;
&lt;p&gt;Three sites use CSS for their layouts instead of tables. This is a good thing and they should be commended for it. However, that does not mean that they can&#39;t be &lt;em&gt;better&lt;/em&gt;. All three with CSS layouts overuse divisions and spans terribly, often making the page a mess without CSS turned on.&lt;/p&gt;
&lt;p&gt;Does this guy do nothing more than whine? I hear you ask. Yes I do. What I will do is nothing special; any one of you reading this could have done it yourself. I&#39;m going to build a simple HTML document mimicking the front page of a poker site. If you are planning to build a site like that (or even if you are the developer of one of the sites above), you should definitely keep reading. The idea with all of this is to make it easier for people to follow the standards.&lt;/p&gt;
&lt;p&gt;I will only include the front page of the site but it won&#39;t be hard to transform it to something simpler later on. Remember the purpose here: to show that it&#39;s possible to combine logical markup, valid code and make it look just the way you want it to. We need some kind of content though, so let&#39;s start with that.&lt;/p&gt;
&lt;h2 id=&#34;plan-what-features-you-want&#34;&gt;Plan what features you want&lt;a href=&#34;#plan-what-features-you-want&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The features for the template will be my picks of the top10 above. Let&#39;s put some time on analyzing what features a decent poker site has.&lt;/p&gt;
&lt;p&gt;The purpose of most of the sites seems to be to &lt;em&gt;get people to play&lt;/em&gt; on their site. Most have some kind of client that is easily available from the front page and that button is the most important part of the page. Aside from that we need features to build a community around the game. Let&#39;s pick &lt;em&gt;a forum&lt;/em&gt; as our community builder. Beginners need to have somewhere to &lt;em&gt;learn the basics&lt;/em&gt; and everyone might need &lt;em&gt;support&lt;/em&gt; from experienced staff sometimes. To build a good community you might also need news of some kind, displaying the largest prizes might give the site more players. Finally, all respectable sites have some info &lt;em&gt;about the company&lt;/em&gt; behind it and if the site is big, they have a &lt;em&gt;search&lt;/em&gt;. We want to earn some money too so let&#39;s add in a little advertisement. Sum this up in a list with descriptions.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Play poker button&lt;/strong&gt;: One big button telling people to click it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Beginners guide and support&lt;/strong&gt;: Show on the front page that you don&#39;t need to be a pro to play and provide a quote from a professional player that illustrates this. Link directly into the guide to show experienced users that there might be something there for them too. Add frequently asked questions to this part too. Give users somewhere to turn to if they have problems.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;News&lt;/strong&gt;: Front page should link to a couple of top news and at the bottom have link to a dedicated news-page with more info.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Forum&lt;/strong&gt;: Users should feel that this is a site with lots of people. Link to the topics in the forum most posted in to show them just that. This site is live and kicking.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt;: Search might be important both if you look for either a poker term or for a feature on the site. Add search for both the forums and the news here and let people decide which of them to search.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;About us&lt;/strong&gt;: Trust is important if you want people to part from their money. Put a picture of the staff online and quote reviews and happy customers (Don&#39;t fake this stuff. Never)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Advertisement (Ads)&lt;/strong&gt;: Ads need needs to be marked up as what they are. We want users to click on the ads only if they like the service the advertisers are serving&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We now need to transform this to HTML somehow. When you do this yourself, try to think as little about the color, fonts and such as possible. Focus on what &lt;em&gt;content&lt;/em&gt; you want to show your users and build the HTML based on that.&lt;/p&gt;
&lt;p&gt;On the next page we will get down to business and start coding. You want to see what I&#39;m talking about don&#39;t you?&lt;/p&gt;
&lt;p&gt;Time has come to go through the list of features and write the code for them. The question which we should keep in mind here is &amp;quot;What content do I have?&amp;quot;.&lt;/p&gt;
&lt;h2 id=&#34;play-poker-button&#34;&gt;Play poker button&lt;a href=&#34;#play-poker-button&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Ok. We want a poker button. Some people prefer to use&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;input type=&amp;quot;submit&amp;quot; /&amp;gt;&lt;/code&gt; for all kinds of buttons. Those buttons are made for submitting a form though, and that&#39;s not what we want here. When you think of it, is this &amp;quot;Play button&amp;quot; any different from a link? I think not. We will make it look like a button with CSS later on. Let&#39;s use the HTML of a simple link:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;play-poker.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Play poker&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;advertisement&#34;&gt;Advertisement&lt;a href=&#34;#advertisement&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;All sites cost money to run and getting that money is often done with some kind of advertisement on the site. What kind of ads should we use for this template? Looking at the top10 it seems that images are more common than text so let&#39;s use images. Don&#39;t forget to let advertisers specify alternate text to their images so you don&#39;t have to make something up for the alt attribute.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Advertisement&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;url_to_advertisers_site.com&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;/files/post-media/play-roulette-online.png&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;alt&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;Advertisement: Play roulette online&amp;quot;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;beginners-guide&#34;&gt;Beginners guide&lt;a href=&#34;#beginners-guide&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To get beginners to play on our site we need to at least teach them the basics. How? People don&#39;t like manuals and they are often hard to navigate in. The best would be if no manual were needed at all, but let&#39;s be realistic, some people will still need help. A good approach is to use questions in natural language to lure people to read the guide. Keep it simple and easy to read. To mark that this is the beginners guide we add a header with that name in. Don&#39;t be tempted to use any other header than h2, the h1 will be used for the name of the site and this is a second level header, nothing else. To mark up the questions we use a paragraph of text with links. At the end we add a link to more information. The class &amp;quot;more&amp;quot; there is just a way to say that this paragraph is different from the one above.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Beginners guide&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
If you are a poker beginner you might want to start by reading
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;help/rules-of-poker.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;the rules&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;. When you are done with that
you can &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;#help/register.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;register an account&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; with us. Don&amp;#39;t worry,
to join is free of charge and you can even win some money in our
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;help/monthly-tournaments.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;monthly tournaments&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;.
More questions are answered in the
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;help/frequently-asked-questions.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;frequently asked questions&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; section
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;news&#34;&gt;News&lt;a href=&#34;#news&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;People playing poker are probably interested in poker news too. By having news on your site your users don&#39;t have to go somewhere else looking for them. This will be a separate section so we should add a header here too, h2 is appropriate. The news items themselves are just items in an unordered list, so let&#39;s use the HTML for that, &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;. End it all with a link to the news page that we wrap it in a classed paragraph like before.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;News&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;23 feb: &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;news/highest-prize-ever&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Highest Prize Ever paid...&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;5 jan: &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;news/caught-cheating&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Top player caught cheating&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;10 dec: &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;news/how-to-improve&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;How to improve your betting&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;1 nov: &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;news/pokercompany-featured&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;PokerCompany featured on...&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;30 okt: &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;news/murkus-baltomi&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Murkus Baltomi the new...&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;24 apr: &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;news/planned-downtime&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Planned downtime on Sunday&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
We maintain an &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;#news/&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;news archive&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; too.
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;forum&#34;&gt;Forum&lt;a href=&#34;#forum&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The forum posts can be handled much like the news. A header, a simple list, this time ordered by with the most active on top. End it with a now familiar classed paragraph.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Forum&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;forum/forum.php?topic=7&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Best strategy with one...&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; - 124 repl.&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;forum/forum.php?topic=572&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Anyone know of a store...?&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; - 115 repl.&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;forum/forum.php?topic=17&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;What&amp;#39;s the name of the...&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; - 89 repl.&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;forum/forum.php?topic=67&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;What your biggest pot?&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; - 51 repl.&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;forum/forum.php?topic=23&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;There was this guy in...&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; - 49 repl.&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;forum/forum.php?topic=325&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Help me get my...&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; - 36 repl.&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;#forum/&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Our forums&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; are always filled with people to answer your questions.
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;search&#34;&gt;Search&lt;a href=&#34;#search&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The bigger the site gets the more important it becomes to get a site search. A search clearly resembles a form; the user fills in a few values and sends them to the site. A simple textbox for the search query with a submit following it.&lt;/p&gt;
&lt;p&gt;Just in case you&#39;re not familiar with the modern way to make a good form I&#39;ll go through the elements used below briefly.&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt; groups similar form elements together. For example, if you have two separate fields for first name and last name, you can signal that they are both part of the full name by adding a fieldset around both of them.&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;&amp;lt;legend&amp;gt;&lt;/code&gt; we then tell what the meaning of the fieldset is. For the previous example we could use &amp;quot;Full name&amp;quot;.&lt;/p&gt;
&lt;p&gt;The last &amp;quot;new&amp;quot; tag here is the &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt;. It simply shows that there are a relation between the text in front of the button and the input box right next to it. A good thing about this relation is that it enables you to click on the label and have the input selected; something that is particularly useful with small radio buttons. This is what the HTML looks like:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;form&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;action&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;search.php&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;get&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;fieldset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;legend&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Site search&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;legend&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;label&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;phrase&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Search: &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;label&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;input&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;phrase&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;input&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;search&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;fieldset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;form&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;about-us&#34;&gt;About us&lt;a href=&#34;#about-us&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Everyone wants to know who they&#39;re dealing with before they make a purchase of some kind (I believe that&#39;s one of the reasons some e-shops have problems, but that&#39;s a completely different story). Anyways, it&#39;s easy for you to put up an image and some quotes from people that are happy with your services, so do it. The header and &amp;quot;more&amp;quot; paragraph should be familiar by now.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;About us&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
PokerCompany has been in the business since 1997 and is...
Want to read &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;about/&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;more about us&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;?
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;On the next page we will take all the pieces of HTML and put them together. It&#39;s getting interesting, don&#39;t you think?&lt;/p&gt;
&lt;h2 id=&#34;what-a-structured-document-looks-like&#34;&gt;What a structured document looks like&lt;a href=&#34;#what-a-structured-document-looks-like&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We have carefully constructed all the markup for the important parts of the site. Notice that we&#39;ve said nothing about the look of it yet, we’re strictly dealing with content.&lt;/p&gt;
&lt;p&gt;We will first add all a good doctype (strict), character encoding and the other things needed for validation. I will not go over this again, it was described a couple of weeks ago in the &lt;a href=&#34;/css/beginners-guide-to-css-and-standards/&#34;&gt;beginner&#39;s guide&lt;/a&gt;. This is just copy and paste, so don&#39;t skip this part.&lt;/p&gt;
&lt;p&gt;Aside from that we also need to add some &amp;quot;hooks&amp;quot;, namely classes and ids, to make it easier to style the document (If you don&#39;t know what those two are I recommend you read through the &lt;a href=&#34;/css/beginners-guide-to-css-and-standards/&#34;&gt;beginners guide&lt;/a&gt; before continuing). Good class and id names have something in common: they describe the content. So using &amp;quot;tinyredbar&amp;quot; is a bad name and using &amp;quot;latestnews&amp;quot; is a good one.&lt;/p&gt;
&lt;p&gt;The basics, the bits of HTML we constructed above and the hooks, together form a &lt;a href=&#34;/files/poker/&#34; data-no-instant&gt;good logical structure&lt;/a&gt; to start with. When looking at that page you will notice that it doesn&#39;t &lt;em&gt;look&lt;/em&gt; pretty. When you view the source of it you will see though - that&#39;s what I want to see when I look at the source of your front page. I get all warm when thinking about it; pure, logical, and accessible content. It&#39;s now time to position things where we want them.&lt;/p&gt;
&lt;h2 id=&#34;apply-some-fancy-css&#34;&gt;Apply some fancy CSS&lt;a href=&#34;#apply-some-fancy-css&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For me the design part always starts with an image program of some sort (Macromedia Fireworks lately for its ease of use). After a while of fiddling around with images and colors I decided to go for something like &lt;a href=&#34;/files/poker/poker-draft.jpg&#34; data-no-instant&gt;this draft&lt;/a&gt; (Note that I&#39;m a programmer rather than a designer so don&#39;t expect wonders here :).&lt;/p&gt;
&lt;p&gt;When you site there with your image in front of you and are on your way to start with the CSS there is one thing you should remember: &lt;em&gt;do the positioning before you do the decoration&lt;/em&gt;. The positioning is the hard part and it &lt;strong&gt;will&lt;/strong&gt; get even harder if you start to mix in colors and fonts. Let&#39;s all follow what I just said and start with the positioning.&lt;/p&gt;
&lt;p&gt;Think of every tag you have on your page as a little box. By &lt;a href=&#34;/files/poker/?style=borders&#34; data-no-instant&gt;enabling borders&lt;/a&gt; on all your elements you can get a good idea of what I&#39;m talking about. When deciding how to position these boxes it&#39;s always wise to start to look at &amp;quot;the flow&amp;quot; of the document. The flow is what you just saw when you looked at the structure above, content is just stacked on top of each other and most tags occupy the full width. By using some clever combinations of floats, clears and widths/heights it is possible to things to line up like we want.&lt;/p&gt;
&lt;h2 id=&#34;positioning-the-header&#34;&gt;Positioning the header&lt;a href=&#34;#positioning-the-header&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let&#39;s start by &lt;a href=&#34;/files/poker/poker-draft.png&#34; data-no-instant&gt;looking at the top&lt;/a&gt;. There seems to be four boxes here: a company name, company info, statistics, and the play button. The big image to the right can be added as a background, so we&#39;ll wait with that one. The first two boxes just need a smaller width to be where we want them (compare with how they where positioned in default flow). The last two ones need to be floated left and given a width (this will place them side by side).&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;65&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;400&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;400&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;130&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;header&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;display&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;block&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;84&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;261&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;positioning-the-navigation&#34;&gt;Positioning the navigation&lt;a href=&#34;#positioning-the-navigation&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Next up we will deal with the navigation and search. Start by adding &lt;code&gt;clear: both&lt;/code&gt; to the navigation to make sure we are below any floats from earlier in the code. To make the navigation list horizontal we add &lt;code&gt;display: inline;&lt;/code&gt; to all list items. We complete the navigation by setting a width on the list and floating it left.&lt;/p&gt;
&lt;p&gt;The search box is a bit harder. All that info won&#39;t fit in the tiny space we have left so my idea is that we hide the fieldset, legend and label. &amp;quot;Why go through the fuzz of adding them and then hiding?&amp;quot;, I hear you shout. Relax. They&#39;re there because they help users that surf the site with CSS turned off, people like your rich grandmother (using Netscape 4), blind users (using screen readers) and Google. Visual users still know that the textbox is for searching because of the &amp;quot;Search&amp;quot; on the button afterwards, so we&#39;re not hiding important information. Ohh, and the header won&#39;t fit our design either so let&#39;s hide that too.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;navigation&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;clear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;both&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;41&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;720&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;navigation&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;list-style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;none&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;400&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;navigation&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;display&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;inline&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;navigation&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;form&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;250&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;navigation&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;legend&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;navigation&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;label&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;navigation&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;position&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;absolute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;-10000&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;text-indent&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;-10000&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;line-height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;navigation&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;fieldset&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;border&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;none&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;positioning-the-advertisements&#34;&gt;Positioning the advertisements&lt;a href=&#34;#positioning-the-advertisements&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Ahhh, &lt;acronym title=&#34;advertisements&#34;&gt;ads&lt;/acronym&gt;, both hated and loved at the same time. Not to include ads on a big site like this would just look strange. Let&#39;s position it like we want. First move it down below the navigation by clearing. Then float it right to get it out of the way from the content below.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;adverts&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;clear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;both&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;positioning-the-content&#34;&gt;Positioning the content&lt;a href=&#34;#positioning-the-content&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This is going well; the content is next up for positioning. Note that I &lt;a href=&#34;/files/poker/&#34; data-no-instant&gt;added a couple of divisions&lt;/a&gt; to this part of the HTML when merging. They will come to good use now as holders of the four sections. Each of the boxes is given a specific width and height and gets floated left.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;200&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;240&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Phew, this feels like a whole days work doesn&#39;t it? On the last page of this tutorial we will put all positioning together and show an example of how everything looks when decorated. Click next below.&lt;/p&gt;
&lt;h2 id=&#34;putting-it-all-together&#34;&gt;Putting it all together&lt;a href=&#34;#putting-it-all-together&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Now it&#39;s time to take all these small parts of CSS, put them in a CSS-file and &lt;a href=&#34;/files/poker/?style=positioning&#34; data-no-instant&gt;apply it on the structure&lt;/a&gt; we had before positioned. Can you &lt;a href=&#34;/files/poker/positioning.css&#34; data-no-instant&gt;recognize the different parts&lt;/a&gt; from the previous page?&lt;/p&gt;
&lt;p&gt;I could bore you to death by explaining every little margin in the decoration step but I won&#39;t. Instead I will just show you the prettied up version of the site. You can have a look at the &lt;a href=&#34;/files/poker/decoration.css&#34; data-no-instant&gt;second CSS file used&lt;/a&gt; if you want.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&#34;/files/poker/?style=positioning&amp;style2=decoration&#34; data-no-instant&gt;Final version of the site&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Let&#39;s have a look at the same properties we looked at in the beginning of this article:&lt;/p&gt;
&lt;table summary=&#34;A look at the web standards compliance of the template&#34;&gt;
  &lt;tr&gt;
    &lt;th&gt;
      Site name
    &lt;/th&gt;
    &lt;th&gt;
      Doctype
    &lt;/th&gt;
    &lt;th&gt;
      Validation errors
    &lt;/th&gt;
    &lt;th&gt;
      Layout method
    &lt;/th&gt;
  &lt;/tr&gt;

  &lt;tr&gt;
    &lt;td&gt;
      Friendlybit template
    &lt;/td&gt;
    &lt;td class=&#34;correct&#34;&gt;
      Strict
    &lt;/td&gt;
    &lt;td class=&#34;correct&#34;&gt;
      0 errors
    &lt;/td&gt;
    &lt;td class=&#34;correct&#34;&gt;
      CSS
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

&lt;h2 id=&#34;summary&#34;&gt;Summary&lt;a href=&#34;#summary&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I hope this tutorial has showed you that CSS far from rocket science; could you not have done this yourself? The web really needs to be freshened up and made accessible for everyone, and with your help it can. Do your part by telling your friends, by holding a short presentation where you work, and by supporting webmaster you know work like this. Use your imagination, how can you make people understand?&lt;/p&gt;
&lt;p&gt;Still here? Ok. If you&#39;re uncertain, ask yourself: can you afford to be left behind?&lt;/p&gt;
&lt;p&gt;I hope this article gave you some insight to the development of a poker site. This article was the first is a series of articles about &lt;a href=&#34;/css/building-niche-sites-with-standards/&#34;&gt;niche templates&lt;/a&gt; so be sure to check back for more. Any comments?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Building niche sites with standards</title>
            <link href="http://friendlybit.com/css/building-niche-sites-with-standards/" rel="alternate" type="text/html" title="Building niche sites with standards" />
            <published>2006-01-23T03:30:56+01:00</published>
            <updated>2006-01-23T03:30:56+01:00</updated>
            <id>http://friendlybit.com/css/building-niche-sites-with-standards/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">I&#39;m starting a new series of articles here at Friendly Bit. Through the use of web standards I will build a couple of niched sites and walk you through...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/building-niche-sites-with-standards/">
                &lt;p&gt;I&#39;m starting a new series of articles here at Friendly Bit. Through the use of web standards I will build a couple of niched sites and walk you through every step of the process. My hope is that this will make it easier for at least a few of you out there to understand what this web standards fuzz is all about. The use of web standards together with your creativity will make building websites fun again.&lt;/p&gt;
&lt;p&gt;The first niche examined is &lt;em&gt;online poker&lt;/em&gt;. The examination ended in a tutorial on &lt;a href=&#34;/css/semantic-poker-template/&#34;&gt;how to build a poker site&lt;/a&gt;. What are you waiting for? Go read it!&lt;/p&gt;
&lt;p&gt;My hope is that the templates will spread all the way to the niche markets they are made for. I appreciate any help with that. No matter what, I hope they will be great articles to learn from. Do you have anything to add? Use the comments.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Line Breaking With Javascript</title>
            <link href="http://friendlybit.com/js/line-breaking-with-javascript/" rel="alternate" type="text/html" title="Line Breaking With Javascript" />
            <published>2006-01-22T00:00:00+01:00</published>
            <updated>2006-01-22T00:00:00+01:00</updated>
            <id>http://friendlybit.com/js/line-breaking-with-javascript/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Over the years there have been numerous suggestions of different ways of doing line breaks on the web. Browser incompatibilities, lack of support for...</summary>
            <content type="html" xml:base="http://friendlybit.com/js/line-breaking-with-javascript/">
                &lt;p&gt;Over the years there have been numerous suggestions of different ways of doing line breaks on the web. Browser incompatibilities, lack of support for standardized features, and the creation of browser specific features all helps in making it incredibly difficult. Searching and reading for a while quickly brought me to think the best current solution is &lt;a href=&#34;http://www.quirksmode.org/blog/archives/2005/06/quirks_mode_and_1.html&#34;&gt;quirksmode&#39;s wbr&lt;/a&gt;. It seems quite well supported but has two major flaws:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;wbr&amp;gt;&lt;/code&gt; is not valid HTML&lt;/li&gt;
&lt;li&gt;The suggested solution does not work in Safari&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So off I went to find a better one. I started trying some different combinations of spaces marked up with &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; tags and I tried some nifty CSS tricks before it hit me - this should be done with javascript. Javascript has wide browser support and after some research (and help from the people in EFNet #javascript) I actually got a &lt;a href=&#34;/files/js-linebreak/&#34; data-no-instant&gt;working example&lt;/a&gt; up. I have been able to test it in FF 1.5/Win, IE 5.5/Win, IE 6/Win, Opera 8.51/Win+Mac, and Safari 2.0.3/Mac and everything seems to work fine in all of them.&lt;/p&gt;
&lt;h2 id=&#34;how-it-works&#34;&gt;How it works&lt;a href=&#34;#how-it-works&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The idea here is to add ordinary &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;s and using javascript to measure the length of the text. The user gives a piece of text and a width in pixels and the script returns the text with breaks inserted.&lt;/p&gt;
&lt;p&gt;The hard part is to find at which letter we should break. My first idea was to just loop over the text and keep track of the width in pixels. When we get over the given width, back one step and add a break at that position. But this will be slow for small font-sizes and wide columns so let&#39;s do something faster. Instead of looping through all letters we can use &lt;a href=&#34;http://en.wikipedia.org/wiki/Binary_search&#34;&gt;Binary Search&lt;/a&gt; (check the link if you&#39;re not familiar with it, it&#39;s good to know). This makes for a lot less calls.&lt;/p&gt;
&lt;p&gt;We need a small change to the algorithm since we won&#39;t be able to find the exact width we&#39;re looking for (a letter is wider than 1px). Instead we break when we&#39;re down to knowing that it&#39;s between two letters. We then return the first letter&#39;s position. Here is code:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;JS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;binSearch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;searchLen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;lastBreakPos&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;while&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;Math&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;abs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;lastBreakPos&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;lastBreakPos&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;Math&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;floor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;searchLen&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getTextWidth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;substring&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;Math&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;min&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;lastBreakPos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The code above uses &lt;code&gt;getTextWidth()&lt;/code&gt; to get the width of a piece of text. &lt;code&gt;getTextWidth()&lt;/code&gt; makes use of the &lt;code&gt;offsetWidth&lt;/code&gt; property to get the width of a piece of text. Problem is that only elements that are rendered have the property set. This means we need to add it to the page, measure it, and then remove it. This code does just that:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;JS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getTextWidth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;createElement&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;span&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;innerHTML&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;appendChild&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;len&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;offsetWidth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;removeChild&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;len&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Good. We now have two nice helper functions to handle all the hard work. Now we only need some code to actually split the text and add the breaks. We do this by using &lt;code&gt;binSearch()&lt;/code&gt; to fetch where the next break should be. &lt;code&gt;binSearch()&lt;/code&gt; returns an index and we split the line and add the first part (including a break) to a buffer. We then repeat the same procedure on the last part of the string. We keep splitting until &lt;code&gt;getTextWidth()&lt;/code&gt; tells us we&#39;re done.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;JS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;linebreak&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;maxLen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getTextWidth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;maxLen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;while&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getTextWidth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;maxLen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;binSearch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;maxLen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;substring&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;substring&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;breakPos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;part2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It&#39;s now time to use the function we have. The first line selects what elements we want to wrap. You can replace this with a loop if you want if you need to go over all the paragraphs in your document. The second line just fetches everything inside the paragraph and sends it to &lt;code&gt;linebreak()&lt;/code&gt; for wrapping. The two lines are then made to trigger when the document is ready loading.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;JS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;onload&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;p&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)[&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;innerHTML&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;linebreak&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;innerHTML&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;200&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A &lt;a href=&#34;/files/js-linebreak/&#34; data-no-instant&gt;working example&lt;/a&gt; is available that shows what it can do. So, what do you think? Could this be the best solution so far to handling line breaks?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Short web standards quiz</title>
            <link href="http://friendlybit.com/css/short-web-standards-quiz/" rel="alternate" type="text/html" title="Short web standards quiz" />
            <published>2006-01-17T18:34:51+01:00</published>
            <updated>2006-01-17T18:34:51+01:00</updated>
            <id>http://friendlybit.com/css/short-web-standards-quiz/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Q1. What does &#34;semantics&#34; mean in the context of web development? To use CSS for layout instead of tables To validate your page according to a given W3C...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/short-web-standards-quiz/">
                &lt;p class=&#34;first&#34;&gt;
  Q1. What does &#34;semantics&#34; mean in the context of web development?
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To use CSS for layout instead of tables&lt;/li&gt;
&lt;li&gt;To validate your page according to a given W3C specification&lt;/li&gt;
&lt;li&gt;To use the most appropriate HTML tags for your content&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&#34;first&#34;&gt;
  Q2. Which was the next CSS specification released after CSS2?
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CSS3&lt;/li&gt;
&lt;li&gt;CSS2.1&lt;/li&gt;
&lt;li&gt;CSS2.0&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&#34;first&#34;&gt;
  Q3. In context of content, presentation, and behaviour. What language is appropriate for the behaviour?
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CSS&lt;/li&gt;
&lt;li&gt;XHTML&lt;/li&gt;
&lt;li&gt;Javascript&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&#34;first&#34;&gt;
  Q4. If you want to mark that a certain word is short for something longer, which HTML tag should you use?
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;acronym&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;abbr&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&#34;first&#34;&gt;
  Q5. Which of the following is NOT possible to do with W3C&#39;s CSS2?
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Change the color of the scrollbar&lt;/li&gt;
&lt;li&gt;Make a div fill the whole height of the page&lt;/li&gt;
&lt;li&gt;Change the distance between lines of text in a paragraph&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&#34;first&#34;&gt;
  Q6. One of the following is a valid doctype, which one?
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;HTML 4.01 Quirks mode&lt;/li&gt;
&lt;li&gt;HTML 4 Standards mode&lt;/li&gt;
&lt;li&gt;HTML 4.01 Strict&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&#34;first&#34;&gt;
  Q7. W3C&#39;s validator (with XHTML 1.0 Transitional doctype) would let through one of the following lines. Which one?
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;adress&amp;gt;Sesame street 34Germany&amp;lt;/adress&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Hello&amp;lt;/font&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;em&amp;gt;&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Data&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/em&amp;gt;&amp;lt;/table&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&#34;first&#34;&gt;
  Q8. The much awaited CSS3 specification includes the following feature:
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An easy way to add shadows to your text&lt;/li&gt;
&lt;li&gt;A way to open windows in new tabs&lt;/li&gt;
&lt;li&gt;Possibility to animate (move) text and images&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&#34;first&#34;&gt;
  Q9. Which of the following is valid CSS2?
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;display: inline-block;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&#34;margin: 0; &#34;&gt;&lt;code&gt;*&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_width: 300px;&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&#34;first&#34;&gt;
  Q10. Which of the following is NOT valid CSS2?
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;span class=&#34;font-size: 200%; &#34;&gt;&lt;code&gt;p:first-letter&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&#34;width: 30ex; &#34;&gt;&lt;code&gt;* html #container&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&#34;background: Silver; &#34;&gt;&lt;code&gt;tr:nth-child(2n) td&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Are you uncertain about any of the questions? Just post a comment and I&#39;ll answer. (You can also use the comments just to show off or points out errors of course :).&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Cross browser CSS for your site</title>
            <link href="http://friendlybit.com/css/cross-browser-strategies-for-css/" rel="alternate" type="text/html" title="Cross browser CSS for your site" />
            <published>2006-01-13T00:21:39+01:00</published>
            <updated>2006-01-13T00:21:39+01:00</updated>
            <id>http://friendlybit.com/css/cross-browser-strategies-for-css/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">This article will go through some useful cross-browser CSS techniques I use to get my sites to look the same in several modern browsers. It&#39;s fairly easy to...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/cross-browser-strategies-for-css/">
                &lt;p&gt;This article will go through some useful cross-browser CSS techniques I use to get my sites to look the same in several modern browsers. It&#39;s fairly easy to send out different versions of your site to different browsers. This should be avoided though since it will end up with you having to maintain the site as if it was in fact several. That defeats the whole purpose with standards, why are they even needed if you are adapting to the browsers instead? My opinion is that good cross-browser coding is to find the set of standards that &lt;em&gt;are&lt;/em&gt; supported and then use them.&lt;/p&gt;
&lt;h2 id=&#34;validate&#34;&gt;Validate your site&lt;a href=&#34;#validate&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Validation is a much debated area and many &lt;a href=&#34;/css/levels-of-css-knowledge/&#34;&gt;Level 2 bosses&lt;/a&gt; doubt that this procedure really helps. It does help though. It ensures that you didn&#39;t do any simple spelling errors, things that could be incredibly hard to find manually. A validator also checks for nesting errors (did you put a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; inside of an anchor?) and other strange things like your character encoding. Information about each of the errors is available as links when they appear, just click on one and you&#39;re on your way to learn something new.&lt;/p&gt;
&lt;p&gt;Validation is the simplest of my tricks to check. There are validators available for both &lt;a href=&#34;http://validator.w3.org/&#34;&gt;(X)HTML&lt;/a&gt; and &lt;a href=&#34;http://jigsaw.w3.org/css-validator/&#34;&gt;CSS&lt;/a&gt;. Use them! Any errors that show up on those lists could be a potential cross-browser breaker so if you decide to ignore any of them you should be really sure about what you are doing. There are reasons why each one of all of the errors on the validation page show up, so validate, fix, validate, fix, validate.&lt;/p&gt;
&lt;h2 id=&#34;mode&#34;&gt;Stay in standards mode&lt;a href=&#34;#mode&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The next trick is not as obvious. Modern browsers have two rendering modes they use to display websites with: &lt;em&gt;Standards mode&lt;/em&gt; and &lt;em&gt;Quirks mode&lt;/em&gt;. Standards mode is a rendering mode that is made to work according to the W3C specifications as closely as possible and Quirks mode is a bug ridden mode made for older sites. Why have a mode with bugs you ask? It&#39;s a way for browser makers to keep their users happy. When you do big changes to your rendering engine a lot of old sites relying on browser bugs will break. Some might think that this is a good thing, why should sites still work when they are poorly coded? If you think like that you have forgot about who the web is for. It&#39;s not a place for experts only, it&#39;s made for regular users, that is, &lt;em&gt;anyone&lt;/em&gt; with a browser. Those people need to see a working site if that&#39;s possible.&lt;/p&gt;
&lt;p&gt;So a new browser is released with a more standards compliant rendering mode and pages start to break. This is a bad thing for users so browser makers decided to first identify pages that tried to follow the standards, and if they did, switch to the new and improved rendering mode. You will probably see why I recommend standards mode now. All browsers are trying to render things as similar to the specs as possible when in standards mode, while in quirks mode they keep all their old bugs just to help regular users.&lt;/p&gt;
&lt;p&gt;So how do the browsers identify who&#39;s trying to follow standards and who&#39;s not? They use the &lt;em&gt;doctype&lt;/em&gt;. If you&#39;re not familiar with doctypes, don&#39;t worry, they are easy to learn. A doctype is a tag on first line of your site file telling the browser what markup language you will be using. There are basically two doctypes you should select among:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;HTML 4.01 Strict (what I recommend)&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01//EN&amp;quot; &amp;quot;http://www.w3.org/TR/html4/strict.dtd&amp;quot;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;XHTML 1.0 Strict (without &lt;code&gt;&amp;lt;?xml ...&amp;gt;&lt;/code&gt; on the line before)&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Strict//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&amp;quot;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Using any of these make sure the browser switches to standards mode and your design not fail because of that. Using a &lt;em&gt;strict&lt;/em&gt; doctype means that you will do your best to separate structure from design and the validator will give you errors in those areas. It&#39;s very useful. (Worth a small note is that the XHTML Transitional doctype also triggers standards mode, but while using transitional you don&#39;t get as many good validation checks so don&#39;t use that one anyways.)&lt;/p&gt;
&lt;p&gt;There is one last catch one needs to talk about when dealing with doctypes and standards mode - &lt;strong&gt;the doctype needs to be the first tag in the document&lt;/strong&gt;. If you put any HTML comments or strange characters before it &lt;acronym title=&#34;Internet Explorer&#34;&gt;IE&lt;/acronym&gt; will go crazy and switch to quirks mode. This has cause many developers countless hours of trying to fix things. Just don&#39;t do it!&lt;/p&gt;
&lt;h2 id=&#34;default&#34;&gt;Remove default styling of elements&lt;a href=&#34;#default&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Another cause of many web developers screaming in the night is the default CSS that is applied to elements. If you don&#39;t use any CSS at all on your page elements will still have a certain look. Headers will be larger than text paragraphs and blockquotes will have padding. Sizes of text is something that is pretty similar across browsers but something that&#39;s not is padding and margins. Let me give you an example: With no styling an &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; gets a padding in Firefox but a margin in IE. Solution? Set either the margin or padding to zero and set the other one to the indentation you want. You need to somehow remove the default browset styles.&lt;/p&gt;
&lt;p&gt;These kinds of problems take up a lot of development time if not handled nicely. &amp;quot;Do definition lists in Opera have padding or margin?&amp;quot;. &amp;quot;What about second level headers in IE 6?&amp;quot;. Two schools of thought have evolved to handling this. The first one tells you to start by resetting &lt;em&gt;all&lt;/em&gt; margins to their defaults at the top of you CSS file. This can easily be done by typing in &lt;span class=&#34;margin: 0; padding: 0; &#34;&gt;&lt;code&gt;*&lt;/code&gt;&lt;/span&gt;, * being a &lt;a href=&#34;http://css.maxdesign.com.au/selectutorial/selectors_universal.htm&#34;&gt;universal selector&lt;/a&gt; that applies the same rules to &lt;em&gt;all&lt;/em&gt; elements.&lt;/p&gt;
&lt;p&gt;Problem solved right? That&#39;s where the second school of thought comes in. They argue that too many default margins are reset. Why should we mess with users form fields, rendering them hard to use unless they are set to good values again? Instead you could just reset those elements that have differences, and leave the rest untouched. This is quite a lot of work to get right so Faruk Ate? built a &amp;quot;starting css&amp;quot; template that you can easily include in your head. Personally I prefer the *-method, but try both and decide for yourself.&lt;/p&gt;
&lt;h2 id=&#34;bugs&#34;&gt;Browser bugs&lt;a href=&#34;#bugs&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This is the area where CSS gets hard. Even though browser makers work their asses off to follow standards they sometimes don&#39;t reach their goals. This leaves us webmasters with bugs that when fixed triggers new bugs, either in the same or another browser. It can easily get real dirty.&lt;/p&gt;
&lt;p&gt;One of the worst browsers (that is widely in use) is Microsoft&#39;s Internet Explorer, version 6. Some claim they have about 80% of the browser market so it&#39;s not a browser you can just ignore. IE was a good browser when it was first released but by today&#39;s standards it&#39;s certainly not. No other browser caused me more pain while building the design of this page. Its shortcomings get painfully clear when it comes to rendering complex CSS layouts.&lt;/p&gt;
&lt;p&gt;How do you handle these bugs then? The easiest (and fastest) way is not solving it yourself but reading up on someone else&#39;s solution. &amp;quot;Holly &#39;n John&amp;quot; have gathered the most frequent bugs on their page &lt;a href=&#34;http://positioniseverything.net/explorer.html&#34;&gt;Explorer Exposed!&lt;/a&gt;. They give you examples of how to detect the bug, how it works and why (sometimes) and most importantly how to solve it. Sometimes the solution is just setting &lt;code&gt;position: relative;&lt;/code&gt; or &lt;code&gt;display: inline;&lt;/code&gt; on some element and sometimes you have to resort to strange code. The point here is that if your bug is on that page; don&#39;t waste time trying to figure it out yourself. Learn that list by heart.&lt;/p&gt;
&lt;p&gt;So what do you do if your bug isn&#39;t on the list? You start by googling for a solution of course. Googling takes a few minutes compared to the hour you probably need to hunt it down. Don&#39;t underestimate this step.&lt;/p&gt;
&lt;p&gt;If you don&#39;t find it somewhere you need to hunt it down yourself. Do this by making a copy of your page and then removing as much code as you can while keeping the bug. Then find out exactly what line (or lines) of code that causes it and finally try to find another way of doing what triggers it. This is much better than just throwing in hacks, you keep your code maintainable and you learn a lot more useful stuff than if you were throwing in nonsense code from the beginning.&lt;/p&gt;
&lt;p&gt;If you for some reason do not manage to solve the bug with the above technique you either rethink what you are doing (not likely) or you go get your arsenal of hacks. Make sure the hacks are valid code. The one I use for IE when nothing else works is the &amp;quot;* html&amp;quot; hack. You use it but writing like this: &lt;span class=&#34;code; &#34;&gt;&lt;code&gt;* html #element&lt;/code&gt;&lt;/span&gt;. That selector selects all tags that have the child html that have the child #element. But &amp;quot;html&amp;quot; is the topmost element in the hierarchy so nothing is selected, unless IE can choose of course. The code gets applied in IE only. Note that it is perfectly valid CSS, it just doesn&#39;t select anything. Remember: hacks are your &lt;em&gt;last resort&lt;/em&gt; when nothing else works.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 18 Jan:&lt;/strong&gt; &lt;a href=&#34;#comment-51&#34;&gt;Richard&lt;/a&gt; in the comments point out that you can also use &lt;a href=&#34;http://www.quirksmode.org/css/condcom.html&#34;&gt;conditional comments&lt;/a&gt; to serve a certain &lt;code&gt;&amp;lt;style&amp;gt; or &amp;lt;link&amp;gt;&lt;/code&gt; to different versions of IE. The &amp;quot;* html&amp;quot;-hack will not work in the comming IE7. Thanks Richard.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I hope you found something useful in this article that you can use when you get cross-browser CSS problems. I have now told you what steps I use, did I miss something? Do you do something differently?&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Levels of CSS knowledge</title>
            <link href="http://friendlybit.com/css/levels-of-css-knowledge/" rel="alternate" type="text/html" title="Levels of CSS knowledge" />
            <published>2006-01-11T01:25:29+01:00</published>
            <updated>2006-01-11T01:25:29+01:00</updated>
            <id>http://friendlybit.com/css/levels-of-css-knowledge/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">As you might have understood by now I&#39;m very much pro web standards. The current widely accepted standards are: (X)HTML for page structure, CSS for design,...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/levels-of-css-knowledge/">
                &lt;p&gt;As you might have understood by now I&#39;m very much pro web standards. The current widely accepted standards are: (X)HTML for page structure, CSS for design, and Javascript for behaviour. HTML is pretty well known by now, it has been there since the beginning of the web and there are tutorials everywhere that gets you started. CSS is starting to get a grip, large companies are switching their sites to CSS based layouts and the webdev blogosphere reaches more and more people.&lt;/p&gt;
&lt;p&gt;When you promote web standards, like many of us do, you get to talk to a lot of people. If you promote it in a live chat room like #CSS on EFNet it gets even clearer: there are a lot of different levels of CSS knowledge out there. This article is going to list some of those levels along a rating of how this kind of developer will affect the web. Here we go:&lt;/p&gt;
&lt;h2 id=&#34;level-0&#34;&gt;Level 0&lt;a href=&#34;#level-0&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;CSS? Isn’t that a multiplayer game?&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;These people have probably never made a webpage in their life. If they did it was pure HTML and they barely knew what they were doing. We get some of these people in #CSS, not because they want to start learning but because they think they&#39;ve come to another channel, often looking for &lt;acronym title=&#34;Counter-Strike: Source&#34;&gt;CS:S&lt;/acronym&gt;. No need to worry about these people, they probably won&#39;t do many webpages in their lives so they can&#39;t do much harm.&lt;/p&gt;
&lt;h2 id=&#34;level-1&#34;&gt;Level 1&lt;a href=&#34;#level-1&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;Yeah, I use it to remove underlines on links sometimes&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Different from Level 0, the people in this level do actually know basic HTML. They probably learned it at least five years ago and have made a couple of simple sites. They use very little CSS, only when they need to do simple stuff you can&#39;t do with HTML only, like removing underlines and setting line-height (No! don&#39;t even think about setting line-height with HTML). While these people could present us with some badly coded sites they rarely have any large and well visited ones. This means that they won&#39;t do much harm either.&lt;/p&gt;
&lt;h2 id=&#34;level-2&#34;&gt;Level 2&lt;a href=&#34;#level-2&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;No, I don&#39;t like divs; tables are much easier to work with&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Instead of just playing with HTML, like those from Level 1, some continued their quest. They mastered HTML tables and started using it to make things look just like they wanted. Somewhere around reaching HTML mastery they stopped looking at new ways of working. They heard about other people using &amp;quot;divs to design their pages&amp;quot; and even took some time one day to try to learn what the fuss was about. After a few hours of not getting it they gave up, went back to the familiar land of tabled layouts, and stayed there. Many do know CSS syntax and sometimes even some background but they believe it&#39;s far too hard and ill-supported to use instead of tables.&lt;/p&gt;
&lt;p&gt;Watch it! These are dangerous people, some even webmasters of big corporate websites. Since they have been in the business for a while many are leaders for their web departments. These are the people it&#39;s most important to reach, and if we do it means a lot for the web. Concentrate on these people all you standards advocates.&lt;/p&gt;
&lt;h2 id=&#34;level-3&#34;&gt;Level 3&lt;a href=&#34;#level-3&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;Yes I&#39;ve heard it&#39;s good, but I can&#39;t use it because of…&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While people in this group still don&#39;t use CSS for positioning they do know some CSS and perhaps heard good things about it. They&#39;ve tried making simple layouts and some even liked how it felt to work with. Problem here is that something is stopping them. Perhaps they have a Level 2 boss, perhaps their website needs to cater for Netscape 4 users, there might be many different reasons but something is in the way.&lt;/p&gt;
&lt;p&gt;These people need to know that while CSS &lt;em&gt;does not&lt;/em&gt; work everywhere that isn&#39;t the end of the world. Old browsers will still get all your content, just pure content. Instead of them you will reach a new audience: there may be accessibility and usability benefits, newer browsers will get a &lt;em&gt;richer&lt;/em&gt; experience and the site might even get easier to add content to (which will lead to more content). Tell this to the people in this group. If you&#39;re unlucky they are not be the ones making decisions but in that case their influence on Level 2 Bosses will still be worth it.&lt;/p&gt;
&lt;h2 id=&#34;level-4&#34;&gt;Level 4&lt;a href=&#34;#level-4&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;CSS? Oh! Yes, I use divs for all my layouts&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It&#39;s not unusual that these people use only divs on their sites. Each part of their page gets a div, often with a carefully crafted id (#toprightredline or even #r5_c7 with r standing for row and c for column), and then they position their divs with absolute positioning by the pixel. The result looks good, hey, it even validates as XHTML 1.1(!) but what they have missed is that most of the benefits of CSS has been lost. These pages are terrible when it comes to a screen reader interpreting it. Same with older non-CSS browsers, they won&#39;t get the content… they will get one big block of text. When using bad class names and ids you loose the possibility to change the layout: if that red line needs to be changed to black you&#39;ll need to change all your HTML documents too (can be hundreds). Don&#39;t fall into the trap of telling them they are stupid or make them google &amp;quot;css&amp;quot;, they know they are smart people and they did learn about CSS from google in the first place. Tell them exactly what could be improved on their sites. Tell them what the benefits are. Keep your cool and tell them &lt;em&gt;why&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;People of Level 4 produce sites that are rather bad. The damage is reduced though by them often being open to new ideas. After all, not to long ago they did manage to learn and start to use CSS.&lt;/p&gt;
&lt;p&gt;Some of the reasons for people thinking this way is because of what &lt;acronym title=&#34;What You See Is What You Get&#34;&gt;WYSIWYG&lt;/acronym&gt; editors are doing. Most such editors produce terrible div-only code but I&#39;m hearing that there are gradual improvements in this field. This is a good thing and hopefully this will help people move from Level 4 to the higher levels.&lt;/p&gt;
&lt;h2 id=&#34;level-5&#34;&gt;Level 5&lt;a href=&#34;#level-5&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;I use CSS for design, it&#39;s better than tables because of…&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;After a lot of reading, talking to people and thinking most people arrive at Level 5. This is where you both &lt;em&gt;can use&lt;/em&gt; CSS and &lt;em&gt;know why&lt;/em&gt; it&#39;s better. Some people in this level have minor problems on the sites they produce but it&#39;s nothing serious. When asked they can argue why separating structure and design is a good thing and they have worked with CSS long enough to know the common pitfalls. I&#39;m guessing many of the readers of this article are on this level and I feel I am. But this is not the best we can do…&lt;/p&gt;
&lt;h2 id=&#34;level-6&#34;&gt;Level 6&lt;a href=&#34;#level-6&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;What version of CSS? Yes, I do. Did you read my book about…&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For some people knowing how and why isn&#39;t enough. These people strive to improve how CSS is used and are publishing great articles on new ways of using it. They constantly go back to the basic needs CSS is filling and attack problems from new angles, often resulting in more great articles. Some have actually read the whole W3C specification on CSS (sic) and they certainly know which parts are supported by which browsers. They function as role models for beginners and do great things for the web with their influence. Many work with the &lt;a href=&#34;http://webstandards.org&#34;&gt;Web Standards Project&lt;/a&gt;. If you ever find an error on their site there is a reason for it. Ask them and they&#39;ll tell you why.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p class=&#34;first&#34;&gt;
  That&#39;s it. I hope this article gave you some inspiration to keep pushing the web to new victories. At which level are you? Do you have examples of people in last level?
&lt;/p&gt;


            </content>
        </entry>
    
        <entry>
            <title type="html">Simple CSS templates</title>
            <link href="http://friendlybit.com/css/simple-css-templates/" rel="alternate" type="text/html" title="Simple CSS templates" />
            <published>2006-01-07T16:25:48+01:00</published>
            <updated>2006-01-07T16:25:48+01:00</updated>
            <id>http://friendlybit.com/css/simple-css-templates/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">The most frequent question in the #CSS channel I&#39;m in is about how you make a 2 column layout. Most beginners seems to have problems understanding how...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/simple-css-templates/">
                &lt;p&gt;The most frequent question in the #CSS channel I&#39;m in is about how you make a 2 column layout. Most beginners seems to have problems understanding how floats work since they are quite different from tables. So I sat down and made some simple layout templates for you. These layouts will all be made with floats since that&#39;s the easiest way to do things. I could have set out to use absolute positioning but that can get tricky when it comes to placing the footer. Let&#39;s stay with floats.&lt;/p&gt;
&lt;p&gt;I&#39;ll recap how a floats work. A float is applied by simply setting &lt;code&gt;float: left&lt;/code&gt; or &lt;code&gt;float: right&lt;/code&gt; on an element in your CSS-file. The element then gets pushed as far to the left or right as possible and the next element will follow to the right (if floated left) or left (if floated right). The closest HTML comparision is the effect you get when setting align=&amp;quot;left&amp;quot; on an image. In the beginning it helped me to think of floats like that.&lt;/p&gt;
&lt;p&gt;There are basically two ways to make 2 column layouts with floats. Either you float all the columns (float-float) or you float all but the last one (float-margin). The former method makes it easier to work with clearing inside of the second columns though, so if you&#39;re going for a complex layout float-float might be better. The latter has the advantage that you don&#39;t have to set a width on the last column. It will fill whatever space is availiable. My favourite is still float-margin though, the automatically expanding second column makes sure the the full width is used no matter what.&lt;/p&gt;
&lt;p&gt;For the examples below I will use the HTML I outlined in my previous article about &lt;a href=&#34;/css/beginners-guide-to-css-and-standards/&#34;&gt;CSS basics&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;the-float-margin-method&#34;&gt;The float-margin method&lt;a href=&#34;#the-float-margin-method&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let&#39;s start by looking at some examples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/files/templates/?style=2columns_float_margin&#34; data-no-instant&gt;2 columns using float-margin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/files/templates/?style=3columns_float_float_margin&amp;cols=3&#34; data-no-instant&gt;3 columns using float-margin&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ok, so how does this work? The first example: The navigation is floated left which means that the next element will follow to the right of it. This sounds right but we are forgetting one thing, what happens if the navigation is very short? Then the text in the right column will continue &lt;a href=&#34;/files/templates/float_example.html&#34; data-no-instant&gt;below the float&lt;/a&gt;, probably not what we wanted. So, to fix this we add a margin-left to our content division. Voilà!&lt;/p&gt;
&lt;p&gt;The 3 column example is based on the same idea. Here we start by floating the navigation left, floating the first content block right and finally add margins to the second content block. The last block needs to have both a margin-left and a margin-right to stop the text from continuing below the left and right columns. Makes sense? Take a look at the code and I hope it will.&lt;/p&gt;
&lt;h2 id=&#34;the-float-float-method&#34;&gt;The float-float method&lt;a href=&#34;#the-float-float-method&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Another method of doing the same is floating each of the columns left. This means that the columns will show up on the webpage in the same order as you put them in the HTML (that was &lt;em&gt;not&lt;/em&gt; the case in the previous example, content1 was to the right and content2 in the middle). Some examples for you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/files/templates/?style=2columns_float_float&#34; data-no-instant&gt;2 columns using float-float&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/files/templates/?style=3columns_float_float_float&amp;cols=3&#34; data-no-instant&gt;3 columns using float-float&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/files/templates/?style=4columns_float_float_float_float&amp;cols=4&#34; data-no-instant&gt;4 columns using float-float&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There isn&#39;t much explaination needed here, only thing different from the float-margin method is that you need to set a width on all your columns. You should easily be able to expand this method to kazillion columns :)&lt;/p&gt;
&lt;p&gt;That&#39;s all, be sure to poke around with the different layouts to get a feel of how they work for you. In my next post I will go through some less static layouts, namely elastic and fluid layout. Comments are availiable for questions.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Added an article on &lt;a href=&#34;/css/what-beginners-ask-for-and-what-i-tell-them/&#34;&gt;Common questions beginners ask&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Make a tooltip out of some columns in a table</title>
            <link href="http://friendlybit.com/css/make-a-tooltip-out-of-some-columns-in-a-table/" rel="alternate" type="text/html" title="Make a tooltip out of some columns in a table" />
            <published>2006-01-06T01:16:59+01:00</published>
            <updated>2006-01-06T01:16:59+01:00</updated>
            <id>http://friendlybit.com/css/make-a-tooltip-out-of-some-columns-in-a-table/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">A worried user joins the #CSS channel on EFNet. He has a big problem with the site he&#39;s currently working on and wonders if there might be a problem with...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/make-a-tooltip-out-of-some-columns-in-a-table/">
                &lt;p&gt;A worried user joins the #CSS channel on EFNet. He has a big problem with the site he&#39;s currently working on and wonders if there might be a problem with his markup. Let&#39;s see what he wants.&lt;/p&gt;
&lt;p&gt;The site sells some kind of houses and each house has a few &amp;quot;options&amp;quot; (let&#39;s pretend a bigger door is one option) that the user should be able to select among. Each of these options has a name and costs a certain amount of money. When you move your mouse over one of the options, he wants more info to pop up in a small box. In the box there should be an image, a store name and strange number. What HTML should he use to mark that up?&lt;/p&gt;
&lt;p&gt;We talked for a while and thought about definition lists containing a div with the extra info in, perhaps a two-column table with a div in the second column? After looking again it became pretty clear, if we just look at his data and not think about the design, all that was left was one big table. Everything that he wants in the tooltip are things that could as well be shown in a big table. So why not use exactly that markup and then use javascript to make some cells only pop up when the row was hovered?&lt;/p&gt;
&lt;p&gt;This is the markup I propose:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;table&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;summary&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;Options for your house&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;thead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Option&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Price&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;tooltip&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Image&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;tooltip&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Store&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;tooltip&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;SKU#&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;th&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;thead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tbody&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Bush&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;$3&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;tooltip a1&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;/files/post-media/bush.jpg&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;alt&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;An alabama bush&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;tooltip a2&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Alabama&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;tooltip a3&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;#23535151&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Bush&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;$3&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;tooltip a1&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;/files/post-media/bush.jpg&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;alt&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;An alabama bush&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;tooltip a2&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Alabama&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;tooltip a3&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;#23535151&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tbody&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What you see there is a plain five column table with some classes spread out to make it easier to fetch what we want with the javascript later on. The whole table is given the id &amp;quot;info&amp;quot;, this makes us able to separate it from other tables on the same page. Each cell that are going to be in the tooltip get the class &amp;quot;tooltip&amp;quot; and an aditional a1-a3 class that simply is used to position the specific cell later on.&lt;/p&gt;
&lt;p&gt;Next we need to do two of things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Loop over the table and hide everything with the class &amp;quot;tooltip&amp;quot;&lt;/li&gt;
&lt;li&gt;Loop over all table rows and add a mouseover function to each of them that makes them show all hidden cells in that particular row&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To fetch all elements that has a certain className we will use Jonathan Snook&#39;s fabulous getElementsByClassName. It takes two arguments, the element whose children it should loop through and the className it should look for. The function looks like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;JS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByClassName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;node&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;classname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[];&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;re&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;ow&#34;&gt;new&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;RegExp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;\\b&amp;#39;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;classname&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;\\b&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;els&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;node&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;*&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;j&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;els&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ij&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;re&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;test&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;els&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;className&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;push&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;els&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next we need to write the code that fulfils the list we wrote previously:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;JS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;// Hide all classes with the className &amp;quot;tooltip&amp;quot;&lt;/span&gt;
&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;tooltips&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByClassName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;body&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)[&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;tooltip&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;tooltips&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;tooltips&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;className&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot; hide&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;tbodies&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;tbody&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;tbodies&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;trows&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;tbodies&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;tr&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;// Add a function to each tr that makes it show it&amp;#39;s cells on mouseover&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;j&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;j&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;trows&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;j&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;trows&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;j&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;onmouseover&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;childtooltips&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByClassName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;tooltip&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;k&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;k&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;childtooltips&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;k&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;            &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;childtooltips&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;k&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;className&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot; hooover&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;// And hides all child cells on mouseout&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;trows&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;j&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;onmouseout&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;childtooltips&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByClassName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;tooltip&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;k&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;k&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;childtooltips&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;k&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;            &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;childtooltips&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;k&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;className&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;               &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;childtooltips&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;k&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;className&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;ow&#34;&gt;new&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;RegExp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot; hooover\\b&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A note here is that we don&#39;t loop over the first table row. That one contains the table headers and shouldn&#39;t react to us hovering it.&lt;/p&gt;
&lt;p&gt;Last but not least we need a few lines of CSS to make the page behave like we want it to. Without either Javascript or CSS enabled a plain table should be shown with all cells visible. If you have both enabled you don&#39;t want the cells that contain the tooltip to take up space in the table. Here&#39;s the code:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;hide&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;-10000&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;position&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;absolute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;hooover&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;80&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;position&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;relative&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;a1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;border&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;solid&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Black&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;300&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;a2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;padding&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;120&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;a3&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;padding&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;200&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &amp;quot;hide&amp;quot; class is added to any element with the class &amp;quot;tooltip&amp;quot;. Why not make the tooltip class hide the cells right away you ask? The answer is that then a non js user would not see those cells at all. This way we get the best of both worlds. To remove the hidden cells from taking up space we remove them from the flow with &lt;code&gt;position: absolute;&lt;/code&gt; and to hide them we use &lt;code&gt;left: -10000px&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The &amp;quot;hooover&amp;quot; class get enabled when we mouseover one of the table rows. It just sets the left value to a far more visible 100px. Lastly we set some styles on the a1-a3 classes that makes the tooltip look a little better. We use a1 as a background and place the other two classes on top of it to make it look like they are in the same box.&lt;/p&gt;
&lt;p&gt;And that&#39;s it, a &lt;a href=&#34;/files/table-tooltip/&#34; data-no-instant&gt;table turned into a tooltip&lt;/a&gt;, another user is a little bit happier and all would be fine... Unless of course the user had left the channel before I could show him my solution. Damn.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Beginner’s guide to CSS</title>
            <link href="http://friendlybit.com/css/beginners-guide-to-css-and-standards/" rel="alternate" type="text/html" title="Beginner’s guide to CSS" />
            <published>2006-01-05T18:11:00+01:00</published>
            <updated>2006-01-05T18:11:00+01:00</updated>
            <id>http://friendlybit.com/css/beginners-guide-to-css-and-standards/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">In the chat channel I&#39;m in, I get to talk to people on a daily basis that have never used CSS before, or are at the very beginning of learning it.. This...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/beginners-guide-to-css-and-standards/">
                &lt;p&gt;In the chat channel I&#39;m in, I get to talk to people on a daily basis that have never used &lt;acronym title=&#34;Cascading StyleSheets&#34;&gt;CSS&lt;/acronym&gt; before, or are at the very beginning of learning it.. This article teaches all the basics you need to make your first CSS powered website. It is aimed at people that know a little &lt;acronym title=&#34;HyperText Markup Language&#34;&gt;HTML&lt;/acronym&gt;, and maybe have made a few websites themselves. Let&#39;s get started.&lt;/p&gt;
&lt;h2 id=&#34;what&#34;&gt;What is CSS?&lt;a href=&#34;#what&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;CSS is a language that adds style (colors, images, borders, margins…) to your site. It&#39;s really that simple. CSS is not used to put any content on your site, it&#39;s just there to take the content you have and make it pretty. First thing you do is link a CSS-file to your HTML document. Do this by adding this line:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;link&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;rel&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;style.css&amp;quot;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The line should be placed in between your &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tags. If you have several pages you could add the exact same line to all of them and they will all use the same stylesheet, but more about that later. Let&#39;s look inside the file &amp;quot;style.css&amp;quot; we just linked to.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;font-size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;40&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;200&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;warning&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;red&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;font-weight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;bold&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;footer&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;background-color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;gray&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You have three &lt;dfn&gt;selectors&lt;/dfn&gt; up there, &lt;code&gt;h1&lt;/code&gt;, &lt;code&gt;.warning&lt;/code&gt; and &lt;code&gt;#footer&lt;/code&gt;. A selector simply points to somewhere in your HTML document. It can be built in many ways and can be a combination of the following building blocks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Element&lt;/li&gt;
&lt;li&gt;Class&lt;/li&gt;
&lt;li&gt;Id&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&#39;m going to go through all three of them and explain what they do.&lt;/p&gt;
&lt;p&gt;An &lt;dfn&gt;element&lt;/dfn&gt; points at a HTML-tag somewhere on your page. In the example above we want to style the &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt;-tag. Note that using an element like that affects all tags with that name, so using &lt;span class=&#34;margin-left: 100px; &#34;&gt;&lt;code&gt;p&lt;/code&gt;&lt;/span&gt; gives &lt;em&gt;all&lt;/em&gt; &lt;code&gt;p&lt;/code&gt;-tags a left-margin.&lt;/p&gt;
&lt;p&gt;Using a &lt;dfn&gt;class&lt;/dfn&gt; is just as simple. When writing &lt;code&gt;.your_class&lt;/code&gt; you style all tags with a class with the name &amp;quot;your_class&amp;quot;. In the example above we have &lt;code&gt;.warning&lt;/code&gt; which will style e.g. &lt;code&gt;&amp;lt;div class=&amp;quot;warning&amp;quot;&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;em class=&amp;quot;warning&amp;quot;&amp;gt;&lt;/code&gt;, that is, any element with the class warning. Classes are used when you want to style just a few of your tags in a way, perhaps you want some of your links red? Add a class to all those links.&lt;/p&gt;
&lt;p&gt;You need one more building block: the &lt;dfn&gt;id&lt;/dfn&gt;. This time you style an element with the attribute &amp;quot;id&amp;quot; set to the id you have chosen. Ids work exactly like classes except for one thing; you can only have one id with a certain name in each of your HTML documents. In the example above we style &lt;code&gt;&amp;lt;div id=&amp;quot;footer&amp;quot;&amp;gt;&lt;/code&gt;. If you look at the example it does make sense: a HTML document may contain several warnings but only one footer. Ids should be used when you want to style just one specific tag.&lt;/p&gt;
&lt;p&gt;Using those three building blocks will take you far but when you get to more advanced layouts you might want to combine the building blocks into more advanced selectors. Just to give you two examples of what you can do: &lt;code&gt;em.warning&lt;/code&gt; to style only those &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt;-tags with the class &lt;code&gt;.warning&lt;/code&gt; set. You can also use &lt;code&gt;#footer a&lt;/code&gt; to style only the links that are nested inside the tag with id &amp;quot;footer&amp;quot;. Pretty nice, isn&#39;t it?&lt;/p&gt;
&lt;p&gt;I could go on forever about the advanced uses of selectors but this is a beginner tutorial so I won&#39;t. If you want all the finer details, go have a look at the excellent &lt;a href=&#34;http://css.maxdesign.com.au/selectutorial/&#34;&gt;Maxdesigns Selectutorial&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let&#39;s go on explaining the code above. Each of the selectors has a set of &lt;dfn&gt;declarations&lt;/dfn&gt; tied to them. Each declaration has a &lt;dfn&gt;property&lt;/dfn&gt;, describing what we want to change and a &lt;dfn&gt;value&lt;/dfn&gt;, what we should change it to. Too many terms there? Are you still with me? Let me explain with an example: &lt;span class=&#34;color: Blue; font-size: 3em; &#34;&gt;&lt;code&gt;a&lt;/code&gt;&lt;/span&gt;. You have the &lt;dfn&gt;selector&lt;/dfn&gt; &lt;code&gt;a&lt;/code&gt; there, so all links in your document will be styled. We have two &lt;dfn&gt;declarations&lt;/dfn&gt;: &lt;code&gt;color: Blue&lt;/code&gt; and &lt;code&gt;font-size: 3em;&lt;/code&gt;. Lastly each declaration consists of two parts: the &lt;dfn&gt;property&lt;/dfn&gt; &lt;code&gt;color&lt;/code&gt; and the &lt;dfn&gt;value&lt;/dfn&gt; &lt;code&gt;Blue&lt;/code&gt;. Phew! Well done for making it this far. The terms above are good to know since it gives you a way to talk about your CSS. If you join a CSS-channel asking for help with your code and they tell you &amp;quot;You have an error in your a-selector in the second declaration&amp;quot; you know exactly where! Right? :)&lt;/p&gt;
&lt;p&gt;Now you will probably ask what properties there are. You have seen &lt;code&gt;font-size&lt;/code&gt; and &lt;code&gt;color&lt;/code&gt; but what else is there? The answer is that there are a &lt;em&gt;LOT&lt;/em&gt; of things you can style and play with. Additionally (close to) all tags are equal in CSS, so you can set e.g. borders and colors of &lt;em&gt;any&lt;/em&gt; element just like you could with a table if you used only HTML. Starting to see the possibilities?&lt;/p&gt;
&lt;p&gt;I won&#39;t go through all the properties here, it would just bore you to death. Instead I&#39;ll point you to another great resource: &lt;a href=&#34;http://www.w3schools.com/css/&#34;&gt;w3schools section about CSS&lt;/a&gt;. Just select one of the menu options to the left to start exploring what CSS can do.&lt;/p&gt;
&lt;p&gt;But don&#39;t you leave me all alone here, there is more to learn! Next we will talk about good and bad coding and there will be a lot of colorful examples for you. Sounds good?&lt;/p&gt;
&lt;h2 id=&#34;separation&#34;&gt;CSS is all about separation&lt;a href=&#34;#separation&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;One of the least followed parts of CSS is the very idea behind it, the idea of separation of content and design. The idea here is that all sites contain two major parts, the content: all your articles, text and photos and the design: rounded corners, colors and effects. Usually those two are made in different parts of a webpage&#39;s lifetime. The design is determined at the beginning and then you start filling it with content and keep the design fixed. So if you just want to add content to your site you don&#39;t want to be forced to mess around with the design, do you? The same thing is true the other way around, if you decide on a redesign, why should you have to mess around with the content, making sure it fits in the new layout?&lt;/p&gt;
&lt;p&gt;In CSS you just add the nifty &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt;-tag I&#39;ve told you about to the head of your HTML document and you have created a link to your design. In the HTML document you put content only, and that link of yours makes sure it looks right. You can also use the exact same link on many of your pages, giving them all of them the same design. You want to add content? Just write a plain HTML document and think about marking things up like &amp;quot;header&amp;quot; instead of &amp;quot;big blue header&amp;quot; and use CSS to make &lt;em&gt;all&lt;/em&gt; headers look the way you want!&lt;/p&gt;
&lt;p&gt;This is a different way of thinking about webpages, and it&#39;s something that took a while for me to understand. To help you I have written some examples of good and bad coding. What&#39;s wrong with this?&lt;/p&gt;
&lt;div class=&#34;incorrect&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;font&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;3&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Welcome to my page&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Comment: The font-tag is design and design shouldn&#39;t be in the HTML document. All design should be in the CSS-file! Instead do this:&lt;/p&gt;
&lt;p&gt;In the HTML:&lt;/p&gt;
&lt;div class=&#34;correct&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Welcome to my page&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;In the CSS:&lt;/p&gt;
&lt;div class=&#34;correct&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;font-size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;One more example:&lt;/p&gt;
&lt;div class=&#34;incorrect&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;An error occurred&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Comment: This looks right doesn&#39;t it? But if you look up what &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt; stands for you quickly find &lt;em&gt;bold&lt;/em&gt;. But bold is certainly design, so it still doesn&#39;t belong in the HTML document. A better choice is &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; that stands for &lt;em&gt;emphasis&lt;/em&gt; or simply &amp;quot;this piece of text is important&amp;quot;. So instead of saying &amp;quot;this text looks like this&amp;quot; you are saying &amp;quot;this text is important&amp;quot; and you let the looks be decided by the CSS. Seems like a minor change, but it illustrates how to select your tags. Use this instead:&lt;/p&gt;
&lt;p&gt;In the HTML:&lt;/p&gt;
&lt;div class=&#34;correct&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;An error occured&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;In the CSS:&lt;/p&gt;
&lt;div class=&#34;correct&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;em&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;font-weight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;bold&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Red&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;One last example:&lt;/p&gt;
&lt;div class=&#34;incorrect&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;first link&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;second link&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;td&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  ...
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Comment: Lots of people format their navigation menu like the above example. But is a navigation menu really a table? If you look up the definition of a table you see that it&#39;s made for tabular data, the same kind of data you would put in an Excel sheet. The example has only one column of data, and no headers… Some people state that they use tables because that means that they can get borders and a background color on their navigation, but that&#39;s exactly what your CSS file is for (not the HTML document). So what should we do? Look deep in the list of &lt;a href=&#34;http://www.w3schools.com/html/&#34;&gt;HTML elements at w3schools&lt;/a&gt; and you&#39;ll find something called an unordered list, &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;. Have a look at this:&lt;/p&gt;
&lt;p&gt;In the HTML:&lt;/p&gt;
&lt;div class=&#34;correct&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;first link&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;second link&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  ...
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;In the CSS:&lt;/p&gt;
&lt;div class=&#34;correct&#34;&gt;&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;border&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;solid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This is probably a different way of thinking about HTML than you&#39;re used to but trust me, when you&#39;ve worked with it for a while you&#39;ll see the power of it. Not only does this way of coding give you a more logical structure, there is also proof that this improves your ranking in search engines and makes it easier for accessibility devices to read your site. This way of designing is great.&lt;/p&gt;
&lt;p&gt;Next we will build a simple HTML template to use as a start when building a new page. Like to see it?&lt;/p&gt;
&lt;h2 id=&#34;building-a-standards-based-html-template&#34;&gt;Building a standards based HTML template&lt;a href=&#34;#building-a-standards-based-html-template&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We have talked a lot about the theory behind CSS and HTML working together to form a site with good structure that is separated from the design. But the first parts of building pages are always the same, you type&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;html&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;header&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
       &lt;span class=&#34;cm&#34;&gt;&amp;lt;!-- Header here! --&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;navigation&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;cm&#34;&gt;&amp;lt;!-- Navigaiton here! --&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;content&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;cm&#34;&gt;&amp;lt;!-- Content here --&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;html&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Ok, there might be some new stuff there so let&#39;s go through the lines one by one. First we state this document&#39;s doctype: what language we use. You might have heard of XHTML, another similar web language, but for a first page we don&#39;t need the features that gives us access to, keep it simple, just go with HTML. Also, the &lt;code&gt;&amp;lt;!doctype html&amp;gt;&lt;/code&gt; above sets the document to use &lt;em&gt;Strict&lt;/em&gt; HTML. To understand that you need to know that there are two kinds of rendering in a browser. One that follows the standards set up by the &lt;a href=&#34;http://www.w3c.org&#34;&gt;W3C&lt;/a&gt;, &lt;dfn&gt;&amp;quot;standards mode&amp;quot;&lt;/dfn&gt;, and one for older pages, called &lt;dfn&gt;&amp;quot;quirks mode&amp;quot;&lt;/dfn&gt;. Standards mode is what we want to use. It makes the pages render (almost) the same in modern browsers and it frees us from being dependent on a specific browser, we&#39;ll just follow the standard. Quirks mode is something of a bug mode. It&#39;s there to keep old pages looking the same as they did before browsers started trying to follow the standards and is therefore intentionally filled with strange bugs. A browser determines which rendering mode to use based on what doctype we use, so make sure you use the right one!&lt;/p&gt;
&lt;p&gt;Ok. That&#39;s a lot of explaining for a single line of code, I&#39;ll be swifter now, next line. You have probably written &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; before in the beginning of your documents. My line is almost like that except that I have added &lt;code&gt;lang=&amp;quot;en&amp;quot;&lt;/code&gt; there. That line tells the browser which language we will use. Why does it matter what language we use? you ask… Well, there is assistive technology that read webpages to people out loud called screen readers. Those &lt;em&gt;have to&lt;/em&gt; know what language it is to be able to pronounce the words. It&#39;s so easy for you to add those few characters so why not do it? If you don&#39;t plan on making an English page you can find your own language code by visiting &lt;a href=&#34;http://www.w3.org/WAI/ER/IG/ert/iso639.htm#2letter&#34;&gt;WAIs Language Codes&lt;/a&gt; and check out the two-letter names there (&lt;em&gt;Note:&lt;/em&gt; language codes are in lowercase).&lt;/p&gt;
&lt;p&gt;Next we have the &lt;em&gt;head&lt;/em&gt; of the document. The head contains a some of meta-information about the page, like character encoding, title and what stylesheet (CSS file) to use. The charset there is the trickiest one so let&#39;s take that first. There are a lot of different letters in a language. When computers where first constructed the engineers only thought about the American/English language, they didn&#39;t even think about the swedish letters å, ä, ö or the deutsch umlaut ü or what about the &amp;amp;-sign? There are a lot of characters and at first there was no general consensus on how to handle them. Then someone came up with the smart idea of grouping them into &lt;em&gt;sets&lt;/em&gt;, groups of characters that are used in certain parts of the world. So, what the meta-tag does is simply to state: &amp;quot;This person wants to input western characters (latin-1 characters)&amp;quot;, and this tells the browser what character set to use. A more genaral approach is to use the utf-8 character set but that quickly gets tricky. Finally we have a text/html there that simply tells the server to send the document as a HTML, not like an image or something like that. The &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; you should be familiar with, if not, google it :)&lt;/p&gt;
&lt;p&gt;That was a lot of info on just a few lines of code, I hope I didn&#39;t give the impression that this stuff is hard, because it&#39;s not. To use the stuff above you just copy and paste it and start filling it with content.&lt;/p&gt;
&lt;p&gt;The body of the document consists of a bunch of divisions, let&#39;s add some content to them:&lt;/p&gt;
&lt;div id=&#34;semantics&#34;&gt;&lt;/div&gt;

&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;...
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;header&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;The name of this page&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;navigation&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Navigation&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;first.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;First&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;second.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Second&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;third.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Third&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;content&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Content&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  Some sample content, add your own here
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;footer&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  This page is written by [Your name] and builds on a &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;http://friendlybit.com&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Friendlybit template&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;.
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
...
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What have we done here? First you should note that a quick overview of the document tells you quite much about the content. You can easily see that some stuff are headers (h1, h2) and some are just a list of links (ul, li, a). Let&#39;s go through the code quickly:&lt;/p&gt;
&lt;p&gt;First we have a header. A header is something that&#39;s most often a big image and some text. Some pages don&#39;t have the header in the HTML at all, they just link to an image and have the text in that image. Problem with that is that neither search engines nor screen readers can get the title text. With the title text being the most important piece of description a visitor has to what page they have come to, you do have a problem. So trust me, keep that text there.&lt;/p&gt;
&lt;p&gt;Next up we have the navigation. Navigation should almost always be marked up as an unordered list of links. I&#39;ve seen the strangest variants of this with tables, nested tables, ``-tags after each line and so on but the only content there is a list of links, why make it something it isn&#39;t? Using a list doesn&#39;t mean it will have to look a certain way, remember that all design is handled in the CSS later on, this is just HTML we are dealing with here. Note: you can easily remove the bullet marks with &lt;code&gt;list-style: none;&lt;/code&gt;, that&#39;s not a reason to use some other HTML.&lt;/p&gt;
&lt;p&gt;The most important part of your HTML document is the content. This is the reason people will visit your page and this is where you should put most of your effort. Mark your headers with appropriate header-tags and make sure they look different from the ordinary text, this makes it easier quickly get a grip of what you&#39;re are trying to say. Use paragraph tags around your paragraphs to make is easier to style your text. The CSS &lt;code&gt;text-indent: 2em;&lt;/code&gt; adds some space before only the first word in each paragraph, just to name one simple thing you can do with CSS when you&#39;ve used good markup.&lt;/p&gt;
&lt;p&gt;Lastly, it could be a good idea to add a footer to your page. Make sure you have some kind of contact information here or somewhere else on your site, who knows what people will want to ask you? If you want to help me you could add a link to this site somewhere on your site too. If you do, thanks alot!&lt;/p&gt;
&lt;p&gt;On the next (and last) page of this short beginners guide we will wrap everything up and add some sample CSS to the mix. All is free for you to copy and use on your page. Ready?&lt;/p&gt;
&lt;h2 id=&#34;full-html-template-and-sample-css&#34;&gt;Full HTML template and sample CSS&lt;a href=&#34;#full-html-template-and-sample-css&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let&#39;s start by putting the two pieces of HTML I showed you together and combine it with some sample CSS: &lt;a href=&#34;/files/example1/&#34; data-no-instant&gt;Sample HTML + CSS&lt;/a&gt;. You can find all code that makes that page below. Feel free to copy the code below and experiment on your own.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;html&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;lang&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;header&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;The name of this page&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;navigation&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Navigation&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;first.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;First&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;second.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Second&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;third.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Third&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;li&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;ul&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;content&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Content&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      Some sample content, add your own here
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;footer&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
      This page is written by [Your name] and builds on a &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;href&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;http://friendlybit.com&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Friendlybit template&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;.
    &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;html&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You should be able to tell what each part of the HTML does by now. Let&#39;s instead have a look at some sample CSS for the structure we have above. If you want to experiment with this code you can copy it to a file named style.css (or any other filename you reference in the &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt;-tag in the HTML) and place it in the same directory as the HTML document.&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;CSS&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;background-color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Green&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;border&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;solid&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Black&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;padding&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;7&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;600&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nt&#34;&gt;h1&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h2&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h3&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h4&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h5&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;h6&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;margin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;navigation&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;150&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;430&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;footer&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;	&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;clear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;both&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let&#39;s go through the six rules above. First we set the background-color of body, and body is the background of everything, so this will do the same as bgcolor did in HTML.&lt;/p&gt;
&lt;p&gt;Next we set some styles on all divisions on the page. We have four of them and with this single rule we affect them all. First we set a black border to be 3 pixels wide (note that there is no space between number and unit in CSS). We then set a padding (the space between the border and content) to be 7 pixels and lastly we set the width of all divs to 600 pixels (note that margins, borders and padding are not included in the width).&lt;/p&gt;
&lt;p&gt;The third rule selects all headers on the page and removes the margins (the space between the border and other nearby elements) from them. The commas are used between the elements to apply the same CSS to all of them.&lt;/p&gt;
&lt;p&gt;Next we have some specific rules for three of the divisions. We position the navigation to the left of the content. This is done by using &lt;dfn&gt;floats&lt;/dfn&gt;, a way to put things side by side. If you have used the align-attribute on images in HTML you will know how floats work, they move the element as far to the left as possible and then let the next element follow right next to it. If you want to put something below a float you need to &lt;dfn&gt;clear&lt;/dfn&gt; it. Clearing moves the element down until it&#39;s below any floats, exactly where we want the footer. So both navigation and content are floated and given a width to match the 600 pixels wide header, and the footer is cleared.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I have added some &lt;a href=&#34;/css/simple-css-templates/&#34;&gt;simple layouts&lt;/a&gt; for you to look at, and a list of &lt;a href=&#34;/css/web-development-pack/&#34;&gt;tools I use when developing&lt;/a&gt;. Hope they help all of you out there that learn by examples.&lt;/p&gt;
&lt;p&gt;Now it&#39;s your turn, you will learn CSS by using it and trying out how things work. So go ahead and play with the sample above. Thanks for reading, and good luck!&lt;/p&gt;
&lt;p&gt;Any ideas of how this guide could be improved? Just leave a comment to the right.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">How this website was built</title>
            <link href="http://friendlybit.com/css/how-this-website-was-built/" rel="alternate" type="text/html" title="How this website was built" />
            <published>2005-12-20T00:00:36+01:00</published>
            <updated>2005-12-20T00:00:36+01:00</updated>
            <id>http://friendlybit.com/css/how-this-website-was-built/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Hi there early readers! Welcome to a newly started web development blog. I know that there are a lot of those around so I will work hard to make it...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/how-this-website-was-built/">
                &lt;p&gt;Hi there early readers! Welcome to a newly started web development blog. I know that there are a lot of those around so I will work hard to make it different and hopefully earn your trust. This site will mainly consist of new stuff; very few of those “news about news” posts, there are better places for that. “Web development” I say, and by that I most often will mean client side techniques like HTML, CSS and Javascript. This is the idea and I hope it will work out.&lt;/p&gt;
&lt;p&gt;This site has been worked on for over a year so it&#39;s about time I get it up and working. This article will talk mostly about how this site has been built. You will hopefully notice that to me it&#39;s important that you practice what you preach.&lt;/p&gt;
&lt;h2 id=&#34;wordpress-as-backbone&#34;&gt;WordPress as backbone&lt;a href=&#34;#wordpress-as-backbone&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I&#39;m running the blog software WordPress 2.0 as the base for all this. I&#39;ve read a lot of good things about it and I know PHP so I thought why not give it a try? In just a week I had written my own theme and a few plug-ins to go with it. WordPress really is well built and easy to use. Any problems I&#39;ve had have been answered in the IRC help-channel by nice people. Kudos to the WordPress team for doing a great job.&lt;/p&gt;
&lt;h2 id=&#34;fireworks-for-building-the-idea&#34;&gt;Fireworks for building the idea&lt;a href=&#34;#fireworks-for-building-the-idea&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;All my layouts start out in Macromedia Fireworks. Fireworks is a nice program to work in even though I&#39;m not used to their other programs. I have tried Photoshop but it just didn&#39;t work out between us. Floating toolboxes? Startup time that makes me fall to sleep? No, I wanted something that’s easy to get started with, and if possible something that had special tools for web development. Fireworks is perfect for this, it’s like a combination of Illustrator and Photoshop and has a user interface that even a beginner learns quickly.&lt;/p&gt;
&lt;p&gt;I played with a few different layouts until I found something I liked. The idea with this one is to put the content in focus. Everything except the content column is dark so the white will stick out. The text starts a bit above the text in the left column and has a big &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; so you know where to start. The comments are placed in the sidebar, mostly because there probably will be very few in the beginning. Don&#39;t take that as an insult, I want to hear what you say, but this is not a forum or wiki :)&lt;/p&gt;
&lt;h2 id=&#34;css-elastic-faux-columns-for-implementing-it&#34;&gt;CSS elastic faux columns for implementing it&lt;a href=&#34;#css-elastic-faux-columns-for-implementing-it&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This site does not use tables for layout (of course!). I&#39;m an operator of a help channel for CSS so that would be unacceptable :) A lot of work has gone to make sure the layout works like it should.&lt;/p&gt;
&lt;p&gt;The layout in Fireworks was complete and I had the hard part left, converting my mock-up to a web site. After many tries I finally decided to go with a zoomable layout. I know this is hard to work with, especially with complex sites like this one but I thought I’d give it a try. Worked out pretty well I think. The biggest bug I know of is that the header look strange in Opera and Safari, as far as I can understand it&#39;s because of a bug in both their rendering engines when calculating percentages. Anyhow, the site works well in both Internet Explorer 6 and Firefox so I hope most of you will see it like it&#39;s meant to.&lt;/p&gt;
&lt;p&gt;The layout is made zoomable by using the em unit on the parent container. When text-zooming (Ctrl + Plus in Firefox and View -&amp;gt; Text Size in &lt;acronym title=&#34;Internet Explorer&#34;&gt;IE&lt;/acronym&gt;) the em unit adjusts to what you select so everything gets nice. There is one big problem with changing text-size though: images do not change size when you text-zoom. So certain parts of the site need to stay fixed and some need to move for the site not to collapse.&lt;/p&gt;
&lt;p&gt;I wanted background-images in all my three columns so having all columns change their sizes started to look hard. Then I stumbled over an article about faux columns that used percentages to position a background-image so that it could grow in both directions. The faux columns technique uses a repeating background-image to fake columns. By using two of those images I could get it working on a 3 column layout with percentages.&lt;/p&gt;
&lt;p&gt;The next step was making the site zoomable. If I set the container to a fixed em width and then use faux columns with percentages throughout the site I get what I want. Everything worked out and I could start working in the small parts. Want to see how much trouble IE gave me? Just have a look in my &amp;quot;decoration&amp;quot; stylesheet, I commented every browser problem I encountered in IE, Opera and FF and solved most of them :)&lt;/p&gt;
&lt;h2 id=&#34;miscellaneous&#34;&gt;Miscellaneous&lt;a href=&#34;#miscellaneous&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;All images used are from &lt;a href=&#34;http://www.sxc.hu&#34;&gt;SXC.hu&lt;/a&gt;, the excellent stock image directory. Highly recommended.&lt;/p&gt;
&lt;p&gt;That&#39;s it people, my site and the idea behind it. I hope you will come back and read my articles. Thanks for reading.&lt;/p&gt;

            </content>
        </entry>
    
</feed>