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

<channel>
	<title>Design is Philosophy - The Pink &#38; Yellow Media Blog &#187; CSS</title>
	<atom:link href="http://www.designisphilosophy.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designisphilosophy.com</link>
	<description>Tutorials and thoughts on Microsoft Expression, CSS and WordPress</description>
	<lastBuildDate>Tue, 24 Aug 2010 16:40:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<atom:link rel='hub' href='http://www.designisphilosophy.com/?pushpress=hub'/>
		<item>
		<title>Book Review: Handcrafted CSS: More Bulletproof Web Design</title>
		<link>http://www.designisphilosophy.com/css/book-review-handcrafted-css-more-bulletproof-web-design-20100811/</link>
		<comments>http://www.designisphilosophy.com/css/book-review-handcrafted-css-more-bulletproof-web-design-20100811/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 17:00:29 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Book Reviews]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[book review]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=845</guid>
		<description><![CDATA[Some context: People keep asking me what books they should read to learn about web design and everything else under the sun. Therefore I&#8217;ve decided I&#8217;m going to start reading books about web design and everything else under the sun and write reviews of them so you can see if it&#8217;s a book you should [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/introducing-design-is-philosophy-20081105/' rel='bookmark' title='Permanent Link: Introducing Design is Philosophy'>Introducing Design is Philosophy</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/in-rewrite-mode-new-version-of-my-book-on-the-way-20090428/' rel='bookmark' title='Permanent Link: In rewrite mode: New version of my book on the way!'>In rewrite mode: New version of my book on the way!</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/my-book-is-finally-here-20081001/' rel='bookmark' title='Permanent Link: My book is finally here!'>My book is finally here!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.designisphilosophy.com/wp-content/uploads/2010/08/handcraftedCSS1-1.jpg"><img src="http://www.designisphilosophy.com/wp-content/uploads/2010/08/handcraftedCSS1-1-506x292.jpg" alt="" title="Handcrafted CSS" width="506" height="292" class="aligncenter size-medium wp-image-856" /></a><em>Some context: People keep asking me what books they should read to learn about web design and everything else under the sun. Therefore I&#8217;ve decided I&#8217;m going to start reading books about web design and everything else under the sun and write reviews of them so you can see if it&#8217;s a book you should check out too.</em></p>
<h3>The One Sentence Review</h3>
<p><a id="static_txt_preview" href="http://www.amazon.com/gp/product/0321643380?ie=UTF8&amp;tag=desigisphilo-20&amp;link_code=as3&amp;camp=211189&amp;creative=373489&amp;creativeASIN=0321643380">Handcrafted CSS: More Bulletproof Web Design</a> is a book by and for web designers and developers with a solid understanding of HTML and CSS who want to push things further with standards-based code and progressive enhancements through CSS3 and other bleeding edge technologies.</p>
<h3>The author(s)</h3>
<p>Handcrafted CSS: More Bulletproof Web Design has one of those weird author listings on the front cover: Dan Cederholm with Ethan Marcotte. If you&#8217;ve watched the movie Julie and Julia you know that &#8220;with&#8221; means that the majority of the book is written by Cederholm while a smaller portion is by Marcotte. For this book I&#8217;d say the book itself is by Cederholm and that it features an essay by Marcotte that brings in a slightly to the left but still highly relevant aspect that elevates its overall quality and usefulness.</p>
<p>Dan Cederholm is the man behind <a title="Simplebits.com - home of Dan Cederholm's musings" href="http://simplebits.com/" target="_blank">Simplebits.com</a> and author of the famous book <a id="static_txt_preview" href="http://www.amazon.com/gp/product/0321509021?ie=UTF8&amp;tag=desigisphilo-20&amp;link_code=as3&amp;camp=211189&amp;creative=373489&amp;creativeASIN=0321509021">Bulletproof Web Design</a> of which the last edition was published in 2007. I have not read that book and by now I have a feeling it is too outdated to invest in. I might pick it up at the library but it&#8217;s doubtful. But people I know and trust say it&#8217;s a great book so I&#8217;ll make that assumption. Cederholm has created some truly impressive websites over time, many of which you have probably visited, and he&#8217;s one of those people who not only knows what he&#8217;s doing and does it better than most but also knows how to communicate that knowledge to others so they can step in his footprints rather than stake out their own way through the wilderness.</p>
<p>Ethan Marcotte is the man behind <a title="UnstoppableRobotNinja.com - Ethan Marcotte's home" href="http://unstoppablerobotninja.com/" target="_blank">UnstoppableRobotNinja.com</a> and he pops up as the co-author of several books including <a id="static_txt_preview" href="http://www.amazon.com/gp/product/B002WIG3UO?ie=UTF8&amp;tag=desigisphilo-20&amp;link_code=as3&amp;camp=211189&amp;creative=373489&amp;creativeASIN=B002WIG3UO">Designing with Web Standards</a> which is one of the next books on my long list of things to read. Like Cederholm Marrcotte has worked on some pretty impressive projects over the years and his understanding of how the web works is hard to rival, even for Cederholm.</p>
<p>Both these gentlemen are at the very forefront of web design and development where standards and best-practices are concerned. As such this combo bodes well for the book they&#8217;ve collaborated on.</p>
<h3>The Book Itself</h3>
<p><a href="http://www.designisphilosophy.com/wp-content/uploads/2010/08/handcraftedCSS-2.jpg"><img src="http://www.designisphilosophy.com/wp-content/uploads/2010/08/handcraftedCSS-2-506x337.jpg" alt="" title="Handcrafted CSS - detail" width="506" height="337" class="aligncenter size-medium wp-image-857" /></a>Excluding front and index matter and preface <a id="static_txt_preview" href="http://www.amazon.com/gp/product/0321643380?ie=UTF8&amp;tag=desigisphilo-20&amp;link_code=as3&amp;camp=211189&amp;creative=373489&amp;creativeASIN=0321643380">Handcrafted CSS: More Bulletproof Web Design</a> is a fairly short book of 204 pages. It&#8217;s in an unusual square-ish shape and comes in full colour with a nice and easy-to-read page layout. Considering the length of other books on the same subject matter it&#8217;s easy to think this book to be a little too light on material and substance. That would be a big mistake. These pages are heavy on real-world examples and applications with very little filler text. Although it has the sub-title &#8220;More Bulletproof Web Design&#8221; the book does not work as an extension of the original book but rather as an appendix. In other words it stands on its own. As a designer/developer with a firm understanding of HTML, CSS and all that surrounds these two code languages I found the book to be an engrossing and immersive read with bucketloads of valuable input. But I can see that without such a solid platform to stand on I would have judged the matter as both superficial and overtly simplistic. Which is the surprising consequence of Cederholm and Marcotte&#8217;s clean-and-simple approach.</p>
<p>Having worked with web design and development for many years I&#8217;ve noticed that as my understanding and skill set improves, my code becomes more and more simplistic and clean while the end result of that same code becomes more advanced. Handcrafted CSS latches onto this by providing even more simplistic and cleaner code examples and solutions to create well functioning and æsthetically pleasing websites. This is a huge benefit if you&#8217;re well versed in web code and a devestating detrement if you&#8217;re just starting out: If you don&#8217;t have a firm grasp on the code and understand what Cederholm and Marcotte is trying to do this book will seem like a series of disjointed code examples that at the same time go in too much detail and skim over the important stuff.</p>
<h4>Futureproofing, progressive enrichment and clearing floats</h4>
<p>Cederholm&#8217;s portion of the book concerns itself with three major elements:</p>
<ul>
<li>Futureproofing</li>
<li>Progressive enrichment through CSS3 (in particular rounded CSS corners, RGBA colours and drop-shadows)</li>
<li>A better model for handling floats and clears</li>
</ul>
<p>These are all hugely important considerations as both the web and the devices we ingest it on evolve but they are easily overlooked because they seem peripheral or subordinate to the issue of getting the content out and working properly.</p>
<p>Cederholm&#8217;s approach (and the root of the name of the book) is that a craftman goes the extra mile to add often invisible but still vital elements to her creations to make them stand out. Those elements, or enrichments, can be anything from a properly wrapping list item to a custom ampersand symbol, a gracefully degrading rounded corner or just introducing a semantically sound solution to float and clear management.</p>
<p><strong>FYI: If you&#8217;re considering buying this book and the sentence above made you shake your head or think &#8220;what the hell is he talking about&#8221; I would recommend getting something else instead.</strong></p>
<p>To me Cederholms chapters were divided evenly between verification, a-ha moments and new information. His approaches to futureproofing &#8211; making sure that designed elements are able to handle content that goes beyond the original drafts (i.e. a button with text that spans more than one line or has long words in it) &#8211; are ones I have strived to live up to even before reading the book. Thus seeing him applying the same philosophies and techniques in his QA process was a verification that I am on the right track. When I started on the section on a semantic solution to floats and clears and saw his ingenious .group solution I was left thinking &#8220;What the hell have I been doing all this time? This makes way more sense!&#8221; Needless to say the lessons learned from these chapters are now being implemented in all my current and future projects. And as I worked my way through the CSS3 examples and Cederholm&#8217;s pragmatic &#8220;progressive enrichment&#8221; approach I gained confidence and found a desire to start incorporating drop shadows, RGBA colours and rounded corners in my designs now rather than wait for all the browsers to get with the program.</p>
<p>Actually, Cederholm&#8217;s attitude toward progressive enrichment deserves special mention here. Whereas a large majority of web professionals have made Internet Explorer bashing into a competitive sport Cederholm proposes a more pragmatic approach: Rather than designing for cutting edge browsers and being frustrated by older browsers not keeping up he creates designs that incorporate <em>rewards</em> for more forward-thinking browsers while incorporating clean and simple solutions for the older generation. This is the only reasonable approach and one I&#8217;ve been promoting myself for years so it&#8217;s good to see I&#8217;m not standing alone on this.</p>
<h4>The Fuid Grid</h4>
<p>Although Ethan Marcotte&#8217;s contribution to the book is only a singular chapter it is a hugely important one. As the title suggests it concerns, and solves, what has been a bit of a mystery for many: The Fluid Grid. Grid-based layouts have been a pillar of print design since the early 1920s and have started making their way onto the web. There are many reasons for this, none of which I will cover here. The challenge with grids on the web has always been that they are either entirely static or at the very least have static elements. This becomes a problem when visitors use devices with unusual or small screen sizes (think a phone, an iPad or a vertically oriented screen) because they are often forced to scroll left and right to access the information on the screen. Marcotte sets out to create a proper fluid grid layout and manages quite well through the use of relative sizes like em and % combined with a fair bit of math. The resulting fluid grid is quite ingenious and introduces flexibility to sites that previously were confined to rigid structures. And practicing what they preach both <a title="UnstoppableRobotNinja.com - Ethan Marcotte's home" href="http://unstoppablerobotninja.com/" target="_blank">Marcotte</a> and <a title="Simplebits.com - home of Dan Cederholm's musings" href="http://simplebits.com/" target="_blank">Cederholm</a> use these types of fluid grid layouts on their own sites. Open them and resize your window to see for yourself.</p>
<h3>The Bottom Line</h3>
<p>The red line running through <a id="static_txt_preview" href="http://www.amazon.com/gp/product/0321643380?ie=UTF8&amp;tag=desigisphilo-20&amp;link_code=as3&amp;camp=211189&amp;creative=373489&amp;creativeASIN=0321643380">Handcrafted CSS: More Bulletproof Web Design</a> is the attitude that a little extra refinement and forethought will bring rewards, in functionality, æsthetics and simplicity. And this attitude is one that can be applied to pretty much every aspect of life, not just web design. Cederholm and Marcotte are both living examples of how well this approach works and their sites stand as testaments to the techniques and parctices.</p>
<p>This book is for the seasoned designer / developer who already has a firm grasp on HTML and CSS but wants to take it further. It is also an excellent introduction to the world of CSS3 and fluid grid layouts for those that want to push their sites and designs into the future. The book is best read while sitting in front of your computer, preferably with a project on hand where the techniques can be implemented immediately. It is when you see the examples take shape and improve your own designs you realize where the value lies in this book. It&#8217;s not as much a list of good code examples as a guide to improving your own work. As such the seemingly disjointed code examples actually make a lot of sense: Rather than presenting pre-packaged functional content they are laid out in such a way that they can be slotted into pretty much any project for instant effect. This falls well in line with the theory that new knowledge is best retained when immediately applied to something that matters to the person learning it.</p>
<p>I wholeheartedly recommend this book wihtin the parameters I just set out and look forward to learning more from both Cederholm and Marcotte.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/introducing-design-is-philosophy-20081105/' rel='bookmark' title='Permanent Link: Introducing Design is Philosophy'>Introducing Design is Philosophy</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/in-rewrite-mode-new-version-of-my-book-on-the-way-20090428/' rel='bookmark' title='Permanent Link: In rewrite mode: New version of my book on the way!'>In rewrite mode: New version of my book on the way!</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/my-book-is-finally-here-20081001/' rel='bookmark' title='Permanent Link: My book is finally here!'>My book is finally here!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/css/book-review-handcrafted-css-more-bulletproof-web-design-20100811/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>By Land, Sea or Air &#8211; A travel blog based on the MyKipple project</title>
		<link>http://www.designisphilosophy.com/news/by-land-sea-or-air-a-travel-blog-based-on-the-mykipple-project-20091022/</link>
		<comments>http://www.designisphilosophy.com/news/by-land-sea-or-air-a-travel-blog-based-on-the-mykipple-project-20091022/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 06:26:01 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[My Book]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=626</guid>
		<description><![CDATA[We&#8217;ve been talking about taking a road trip through the USA for a long time, so when my TV job ended in October we decided now was the time. And in true blogger fashion, a road trip required a dedicated blog just for that and nothing else. This also presented an opportunity for me to [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/new-wordpress-based-site-the-readers-companion-20081002/' rel='bookmark' title='Permanent Link: New WordPress based site: The Reader&#8217;s Companion'>New WordPress based site: The Reader&#8217;s Companion</a></li>
<li><a href='http://www.designisphilosophy.com/news/my-book-is-featured-in-the-canadian-user-experience-blog-20081201/' rel='bookmark' title='Permanent Link: My book is featured in the Canadian User Experience Blog'>My book is featured in the Canadian User Experience Blog</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/wordpress-as-cms-the-project-20080312/' rel='bookmark' title='Permanent Link: WordPress as CMS &#8211; The Project'>WordPress as CMS &#8211; The Project</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-627" title="By Land, Sea or Air" src="http://www.designisphilosophy.com/wp-content/uploads/2009/10/bylandseaorair.jpg" alt="By Land, Sea or Air" width="506" height="571" />We&#8217;ve been talking about taking a road trip through the USA for a long time, so when my TV job ended in October we decided now was the time. And in true blogger fashion, a road trip required a dedicated blog just for that and nothing else. This also presented an opportunity for me to show people how far you can push the MyKipple.com design I created for my new book Sams Teach Yourself Micrsoft Expression Web 3 in 24 Hours.</p>
<p>The result was <a title="Follow our road trip around the USA" href="http://bylandseaorair.com" target="_blank">ByLandSeaOrAir.com</a> &#8211; a WordPress based site with a theme that utilizes all the tips and techniques showcased in the book. Fact is if you go in and lift out all the code and graphics from the new site you&#8217;ll see that it matches the final project in the book almost line by line.</p>
<p>So the site serves two purposes: To tell the world of our travels and to show that there really is no limit to what you can do once you understand the principles behind HTML and CSS. Enjoy.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/new-wordpress-based-site-the-readers-companion-20081002/' rel='bookmark' title='Permanent Link: New WordPress based site: The Reader&#8217;s Companion'>New WordPress based site: The Reader&#8217;s Companion</a></li>
<li><a href='http://www.designisphilosophy.com/news/my-book-is-featured-in-the-canadian-user-experience-blog-20081201/' rel='bookmark' title='Permanent Link: My book is featured in the Canadian User Experience Blog'>My book is featured in the Canadian User Experience Blog</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/wordpress-as-cms-the-project-20080312/' rel='bookmark' title='Permanent Link: WordPress as CMS &#8211; The Project'>WordPress as CMS &#8211; The Project</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/news/by-land-sea-or-air-a-travel-blog-based-on-the-mykipple-project-20091022/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Why a CSS Reset should be at the core of your stylesheet</title>
		<link>http://www.designisphilosophy.com/css/why-a-css-reset-should-be-at-the-core-of-your-stylesheet-20090817/</link>
		<comments>http://www.designisphilosophy.com/css/why-a-css-reset-should-be-at-the-core-of-your-stylesheet-20090817/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 23:30:20 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=567</guid>
		<description><![CDATA[The CSS Reset is a little known and often overlooked tool in web design that makes cross-browser and cross-platform compatibility a lot easier. It also ensures that you start with a clean sheet when building CSS-based web sites, whether they be single pages, static sites, WordPress sites or anything else. In my view the CSS [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/tutorials/html-basics-hyperlink-syntax-absolute-relative-and-root-relative-20090824/' rel='bookmark' title='Permanent Link: HTML Basics: Hyperlink Syntax &#8211; Absolute, Relative and Root-relative'>HTML Basics: Hyperlink Syntax &#8211; Absolute, Relative and Root-relative</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/center-a-page-horizontally-using-css-an-expansion-20080322/' rel='bookmark' title='Permanent Link: Center a Page Horizontally Using CSS &#8211; An Expansion'>Center a Page Horizontally Using CSS &#8211; An Expansion</a></li>
<li><a href='http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/' rel='bookmark' title='Permanent Link: Highlight current page in WordPress menus'>Highlight current page in WordPress menus</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-570" title="CSS Reset" src="http://www.designisphilosophy.com/wp-content/uploads/2009/08/cssreset.jpg" alt="CSS Reset" width="506" height="246" />The <a title="Eric A. Meyer's CSS Reset Reloaded" href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/" target="_blank">CSS Reset</a> is a little known and often overlooked tool in web design that makes cross-browser and cross-platform compatibility a lot easier. It also ensures that you start with a clean sheet when building CSS-based web sites, whether they be single pages, static sites, WordPress sites or anything else. In my view the CSS reset is so important that web designers, even those just starting out, should use it at all times and make it the foundation of any and all style sheets they create. In fact the employment of the CSS Reset is a main tenant in both my books on Expression Web 2 and Expression Web 3 and is the basis of all my own design projects including the <a title="Free WordPress theme Typograph" href="http://wordpress.org/extend/themes/typograph" target="_blank">free WordPress theme Typograph</a>.</p>
<h3>Why do I need a CSS Reset?</h3>
<p>If you&#8217;ve never worked with a CSS Reset before I can pretty much guarantee that the question you are itching to ask is &#8220;why do I need a CSS Reset&#8221;. After all, you&#8217;ve designed or worked with numerous CSS-based sites in the past and even though they didn&#8217;t have a CSS Reset they work just fine. Right? Well, let me ask you this: If you&#8217;ve ever tried to design a site from scratch using CSS, and you&#8217;ve tried to make it cross-browser compatible, you&#8217;ve probably noticed that your styles don&#8217;t always look the same in different browsers even though they should. In most cases this has been a Internet Explorer vs. the rest type of battle and you&#8217;ve probably written it off as such and just picked a side. But that&#8217;s not the only, or right for that matter, solution. If you run into a browser incompatibility issue where CSS is concerned, it&#8217;s more often than not due to the fact you haven&#8217;t properly defined your styles leaving it up to the respective browser to make guesses as to what you want the site to look like.</p>
<p>To put it in simpler terms: If you don&#8217;t define all the default CSS parameters in your style sheet, the browser will use its default parameters instead. And since different browsers have different parameters your site will end up looking different depending on what browser you use.</p>
<h3>What does the CSS Reset do?</h3>
<p>As the name suggests, the CSS Reset resets all the default CSS parameters to a neutral position thus overriding any predefined assumptions at the hands of the browser. That&#8217;s a bit of a vague explanation so I&#8217;ve made a visual example that illustrates it perfectly:</p>
<p><img class="aligncenter size-full wp-image-568" title="CSS Reset example" src="http://www.designisphilosophy.com/wp-content/uploads/2009/08/css-reset-example.jpg" alt="CSS Reset example" width="506" height="556" /></p>
<p>The image above shows the same piece of basic HTML displayed when no CSS is defined and when the CSS Reset is applied. It is pretty obvious what happens: When you create a HTML page with some basic tags like &lt;h1&gt;, &lt;p&gt;, &lt;blockquote&gt; and &lt;ul&gt; without defining the styles of these tags with CSS, the browser applies its default stylesheet to these tags. But like I said earlier, different browsers have different standard stylesheets and as a result the page won&#8217;t look the same across all browser. And although this isn&#8217;t really a big problem when we&#8217;re talking super-basic stuff like what is displayed above, it becomes a serious pain in the neck when you create complicated CSS layouts.</p>
<h3>So all I&#8217;m doing is creating more work for myself?</h3>
<p>Unfortunately the gut reaction from a lot of people when they see the image above is &#8220;Oh crap! Why would I ever do that? I just create tons of work for myself.&#8221; Well, that&#8217;s partly true: With a CSS Reset applied you do have to manually define all your styles unless you like the reset look (I don&#8217;t). But on the bright side that also means you are now in complete control of every aspect of your site and nothing is left to chance any more. And in my book the former far outweighs the latter.</p>
<p>If that doesn&#8217;t convince you, consider this: Before I startet using the CSS Reset in all my projects, I spent a lot of time trying to jury rig my code into playing nice in all browsers. This often included using IE hacks and JavaScript. After emplying the CSS Reset I only rarely encounter these problems, and when I do it&#8217;s usually because I made a mistake somewhere.</p>
<h3>Alright, I&#8217;m sold. How do I start using the CSS Reset?</h3>
<p>There are several CSS Resets available out there. The one I use is CSS guru Eric A. Meyer&#8217;s <a title="Eric A. Meyer's CSS Reset Reloaded" href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/" target="_blank">Reset Reloaded</a>. It seems to be the most comprehensive reset and it is constantly being updated. To employ it I simply copy the code from the site and paste it in at the very top of my stylesheet. When it comes time to work on my own styles I make new ones leaving the CSS Reset intact. Cascading Style Sheets work as a cascade from the top down which means with the CSS Reset on top the browser will first read all the reset styles and then whatever styles I define below and apply them in order. That way the layout is guaranteed to be clean of browser junk and only shows my style code.</p>
<p>That really is all there is to it. So employ the CSS Reset and go forth and code.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/tutorials/html-basics-hyperlink-syntax-absolute-relative-and-root-relative-20090824/' rel='bookmark' title='Permanent Link: HTML Basics: Hyperlink Syntax &#8211; Absolute, Relative and Root-relative'>HTML Basics: Hyperlink Syntax &#8211; Absolute, Relative and Root-relative</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/center-a-page-horizontally-using-css-an-expansion-20080322/' rel='bookmark' title='Permanent Link: Center a Page Horizontally Using CSS &#8211; An Expansion'>Center a Page Horizontally Using CSS &#8211; An Expansion</a></li>
<li><a href='http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/' rel='bookmark' title='Permanent Link: Highlight current page in WordPress menus'>Highlight current page in WordPress menus</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/css/why-a-css-reset-should-be-at-the-core-of-your-stylesheet-20090817/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Typograph &#8211; new WordPress Theme</title>
		<link>http://www.designisphilosophy.com/css/typography-new-wordpress-theme-20081127/</link>
		<comments>http://www.designisphilosophy.com/css/typography-new-wordpress-theme-20081127/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 17:59:21 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[wp themes]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=205</guid>
		<description><![CDATA[I&#8217;ve closed the comments for this thread to consolidate all comments for the different versions of the Typograph theme in one place. Please leave all your comments at the Typograph page which can be found by clicking here. I&#8217;ve been planning to launch a proper free WordPress theme for some time now but there have [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/wordpress-themes/typograph-theme-update-now-with-threaded-comments-20090113/' rel='bookmark' title='Permanent Link: Typograph Theme Update &#8211; Now With Threaded Comments'>Typograph Theme Update &#8211; Now With Threaded Comments</a></li>
<li><a href='http://www.designisphilosophy.com/wordpress-themes/typograph-critical-update-for-wordpress-28-20090611/' rel='bookmark' title='Permanent Link: Typograph Critical Update for WordPress 2.8'>Typograph Critical Update for WordPress 2.8</a></li>
<li><a href='http://www.designisphilosophy.com/news/typograph-for-wordpress-27-coltrane-released-20081211/' rel='bookmark' title='Permanent Link: Typograph for WordPress 2.7 Coltrane released'>Typograph for WordPress 2.7 Coltrane released</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.pinkandyellow.com/wp-content/uploads/2008/11/typographtheme.jpg"><img class="aligncenter size-full wp-image-206" title="Typograhy WordPress Theme" src="http://blog.pinkandyellow.com/wp-content/uploads/2008/11/typographtheme.jpg" alt="" width="500" height="265" /></a></p>
<blockquote><p>I&#8217;ve closed the comments for this thread to consolidate all comments for the different versions of the Typograph theme in one place. Please leave all your comments at the <a title="Typograph theme page" href="http://blog.pinkandyellow.com/free-wordpress-themes/typograph/" target="_blank">Typograph page which can be found by clicking here</a>.</p></blockquote>
<p>I&#8217;ve been planning to launch a proper free WordPress theme for some time now but there have always been major projects in the way. This week I had some extra time so I sat down and developed the Typograph theme which is now available for anyone to use. For free.</p>
<p>The theme is as simple as possible with clear separation between the content and the sidebar, a calm gray and white design with popping red links, a tabbed sidebar box with navigation, search and other important elements and some other styling for increased readability and better navigation. It complies with the new WordPress standard elements like image captions and Gravatars and even has a customizable ad space directly under the first post on the front page. And last but not least, Typograph is fully <a title="Valid W3C XHTML 1.0 Strict" rel="external" href="http://validator.w3.org/check/referer"> XHTML</a> and 		<a title="Valid W3C CSS" rel="external" href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3"> CSS</a> standards compliant.</p>
<h4><a title="Download the free Typograph WordPress Theme" href="http://wordpress.org/extend/themes/typograph" target="_blank">Download the Typograph theme from the WordPress Theme Directory here!</a></h4>
<h4><a title="Typograph Theme Demo" href="http://wp-themes.com/typograph" target="_blank">See a demo of the Typograph theme here</a></h4>
<h3>No images</h3>
<p>Right before I began the design of this theme, <a title="SpyreMag" href="http://spyremag.com" target="_blank">Spyremag</a> published an article about <a title="Read the article" href="http://spyremag.com/5-ways-to-break-your-design-habits-just-for-fun/" target="_blank">5 ways to break your design habits</a>, one of which was to design a site using no images. Seeing as I&#8217;ve become somewhat obsessed with CSS over the last year it seemed only appropriate to follow this advice and create a no-images theme. Not only would this be a bit of a challenge because I ususually use a lot of images to make my designs more vibrant, but it would also put my coding skills and my understsanding of WordPress themes to the test.</p>
<h3>Styled from scratch</h3>
<p>Over the last several months I&#8217;ve been refining and customizing a copy of the <a title="The Sandbox WordPress theme" href="http://www.plaintxt.org/themes/sandbox/" target="_blank">Sandbox WordPress theme</a> to develop an ideal platform for quick and easy WordPress theme design. The plan is to create a &#8220;God Theme&#8221; if you will that has all the bells and whistles installed and ready to go so that new theme design is quick and efficient. To put the alpha version of this foundation theme to the test I used it to style Typograph from scratch.</p>
<h3>Tabbed box navigation</h3>
<p><img class="alignleft size-full wp-image-207" title="Tabbed Box" src="http://blog.pinkandyellow.com/wp-content/uploads/2008/11/tabbedbox.jpg" alt="" width="227" height="209" />When I created the new theme for <a title="Design is Philosophy - WordPress, CSS and design tutorials" href="http://blog.pinkandyellow.com">Design is Philosophy</a> I spent quite a bit of time developing and perfecting a <a title="JQuery - smart little JavaScript library" href="http://jquery.com/" target="_blank">JQuery</a> and CSS based tabbed sidebar box that would contain navigation as well as other useful information for the visitor. For Typograph I further developed the tabbed box and isolated it in it&#8217;s own file to simplify customization for the user. It can also easily be deactivated by commenting out a single line of code in the sidebar.php template. The tabbed box contains navigation for pages and categories along with an about section, RSS link and search box by default. It takes standard WordPress tags and can be customized to include pretty much anything by editing the tabbedBox.php file found in the theme directory.</p>
<h4><a title="Download the free Typograph WordPress Theme" href="http://wordpress.org/extend/themes/typograph" target="_blank">Download the Typograph theme from the WordPress Theme Directory here!</a></h4>
<h4><a title="Typograph Theme Demo" href="http://wp-themes.com/typograph" target="_blank">See a demo of the Typograph theme here</a></h4>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/wordpress-themes/typograph-theme-update-now-with-threaded-comments-20090113/' rel='bookmark' title='Permanent Link: Typograph Theme Update &#8211; Now With Threaded Comments'>Typograph Theme Update &#8211; Now With Threaded Comments</a></li>
<li><a href='http://www.designisphilosophy.com/wordpress-themes/typograph-critical-update-for-wordpress-28-20090611/' rel='bookmark' title='Permanent Link: Typograph Critical Update for WordPress 2.8'>Typograph Critical Update for WordPress 2.8</a></li>
<li><a href='http://www.designisphilosophy.com/news/typograph-for-wordpress-27-coltrane-released-20081211/' rel='bookmark' title='Permanent Link: Typograph for WordPress 2.7 Coltrane released'>Typograph for WordPress 2.7 Coltrane released</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/css/typography-new-wordpress-theme-20081127/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>Pure CSS Drop-Down Menu tutorial &#8211; a slight omission</title>
		<link>http://www.designisphilosophy.com/microsoft-expression-web/pure-css-drop-down-menu-tutorial-a-slight-omission-20081121/</link>
		<comments>http://www.designisphilosophy.com/microsoft-expression-web/pure-css-drop-down-menu-tutorial-a-slight-omission-20081121/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 19:14:52 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Expression Web]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[drop-down]]></category>
		<category><![CDATA[drop-down menu]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[newsletter]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=201</guid>
		<description><![CDATA[I just got a comment from a reader of my recent Expression Newsletter article The No-Code Way to a Pure CSS Horizontal Drop-Down Menu with Expression Web. He was having trouble getting the grey boxes to &#8220;fill out&#8221; properly which left the menu looking weird. A quick review of his CSS told me the problem [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/fancy-interactive-pure-css-list-boxes-with-hover-effect-20080503/' rel='bookmark' title='Permanent Link: Fancy Interactive Pure CSS List Boxes with Hover Effect'>Fancy Interactive Pure CSS List Boxes with Hover Effect</a></li>
<li><a href='http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/' rel='bookmark' title='Permanent Link: Highlight current page in WordPress menus'>Highlight current page in WordPress menus</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression/video-tutorial-editing-and-uploading-the-zufall-side-buttons-20070825/' rel='bookmark' title='Permanent Link: Video Tutorial: Editing and Uploading the Zufall Side Buttons'>Video Tutorial: Editing and Uploading the Zufall Side Buttons</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I just got a comment from a reader of my recent Expression Newsletter article <a title="The No-Code Way to a Pure CSS Horizontal Drop-Down Menu with Expression Web" href="http://expression.microsoft.com/en-us/dd279540.aspx" target="_blank">The No-Code Way to a Pure CSS Horizontal Drop-Down Menu with Expression Web</a>. He was having trouble getting the grey boxes to &#8220;fill out&#8221; properly which left the menu looking weird.</p>
<p>A quick review of his CSS told me the problem was he didn&#8217;t have the display property set to block. A slight omission for sure but I was more focused on where it originated. A quick read of the paragraph in the article showed me that somewhere in the editing (probably during my rigorous clean-up) this small but important piece of code was ommitted. Which means if people follow the tutorial step by step they&#8217;ll run into the same problem.</p>
<p>I&#8217;ve already informed the newsletter team of the issue and hopefully they&#8217;ll fix it presently. In the meantime, if you&#8217;ve run into this problem and you found your way to this blog, here is the full paragraph and the resulting code:</p>
<p>5th paragraph under the heading &#8220;Style the links&#8221;:</p>
<blockquote><p>To set the height of the link go to the Block category and set the line-height attribute to 30px to match the height of the ul li style you defined earlier. The reason you are using the line-height attribute instead of the height attribute is that line-height automatically places the text at vertical center. If you were to use height you would have to set the vertical placement manually using padding. To set the width, go to the Position category and set width to 150px to match. <em><strong>Finally, to &#8220;fill out&#8221; the area with the background colour, go to the Layout category and set display to block.</strong></em></p></blockquote>
<p>The resulting code should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul li a <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#808080</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">142px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>You can find a full working version of the menu <a title="The drop-down menu" rel="nofollow" href="http://pinkandyellow.com/tutorials/menu.html" target="_blank">here</a> and it’s CSS <a title="The drop-down menu CSS" rel="nofollow" href="http://pinkandyellow.com/tutorials/drop-down.css" target="_blank">here</a> for reference.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/fancy-interactive-pure-css-list-boxes-with-hover-effect-20080503/' rel='bookmark' title='Permanent Link: Fancy Interactive Pure CSS List Boxes with Hover Effect'>Fancy Interactive Pure CSS List Boxes with Hover Effect</a></li>
<li><a href='http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/' rel='bookmark' title='Permanent Link: Highlight current page in WordPress menus'>Highlight current page in WordPress menus</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression/video-tutorial-editing-and-uploading-the-zufall-side-buttons-20070825/' rel='bookmark' title='Permanent Link: Video Tutorial: Editing and Uploading the Zufall Side Buttons'>Video Tutorial: Editing and Uploading the Zufall Side Buttons</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/microsoft-expression-web/pure-css-drop-down-menu-tutorial-a-slight-omission-20081121/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Highlight current page in WordPress menus</title>
		<link>http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/</link>
		<comments>http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 00:33:36 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=191</guid>
		<description><![CDATA[I have published an updated tutorial on this topic entitled Highlight Current Page or Category in WordPress 3.0 Menus. Click here to read the new article. WordPress has a lot of built in functionality that you can tap for advanced customization. One of these which is often ignored is the ability to highlight the current [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/' rel='bookmark' title='Permanent Link: Highlight Current Page or Category in WordPress 3.0 Menus'>Highlight Current Page or Category in WordPress 3.0 Menus</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/new-wordpress-based-site-the-readers-companion-20081002/' rel='bookmark' title='Permanent Link: New WordPress based site: The Reader&#8217;s Companion'>New WordPress based site: The Reader&#8217;s Companion</a></li>
<li><a href='http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-20081106/' rel='bookmark' title='Permanent Link: Create a Twitter box in your sidebar'>Create a Twitter box in your sidebar</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<blockquote><p>I have published an updated tutorial on this topic entitled <a href="http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/" title="Highlight Current Page or Category in WordPress 3.0 Menus">Highlight Current Page or Category in WordPress 3.0 Menus</a>. <a href="http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/" title="Highlight Current Page or Category in WordPress 3.0 Menus">Click here</a> to read the new article.</p></blockquote>
<p><img class="aligncenter size-full wp-image-194" title="Current Page Menu Item" src="http://blog.pinkandyellow.com/wp-content/uploads/2008/11/currentpageitemmenu.jpg" alt="" width="500" height="42" />WordPress has a lot of built in functionality that you can tap for advanced customization. One of these which is often ignored is the ability to highlight the current page in menus with CSS. By default, WordPress assigns a special style class to the button that points to the current page. By styling this class differently from the &#8220;regular&#8221; classes the current page button is highlighted.</p>
<p>In this tutorial we&#8217;ll look at how to utilize the built in current page styling, how to create a menu like the one you see <a href="http://blog.pinkandyellow.com/tutorials/selectedTab/selectedTabDemo.html" title="Fancy menu example" target="_blank">above</a> and also how to hard code the functionality into a menu that is not generated dynamically by WordPress.</p>
<h4>Identifying the custom styles</h4>
<p>If you view the source code of a WordPress blog with a menu like the <a title="The reader's companion to my book" href="http://expression.pinkandyellow.com/" target="_blank">Reader’s Companion</a> you&#8217;ll see that the menu items have been given different classes automatically by the CMS:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item current_page_item&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com&quot;</span>&gt;</span>home<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-9&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Lesson Files&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/lesson-files/&quot;</span>&gt;</span>Lesson Files<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-11&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;About the Author&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/about-the-author/&quot;</span>&gt;</span>About the Author<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-13&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;FAQ&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/faq/&quot;</span>&gt;</span>FAQ<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-15&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Further Reading&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/further-reading/&quot;</span>&gt;</span>Further Reading<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-17&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Contact&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/contact/&quot;</span>&gt;</span>Contact<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>The important classes here are <em>page_item</em> which styles all the menu items and <em>current_page_item</em> which is only applied to the current page item. By styling these two classes independently you can get some very nice results. To demonstrate how far you can take this I&#8217;ve made a mock-up page that simulates the end output of a WordPress menu with custom styling. You can find it <a title="Current selected page tab demo" href="http://blog.pinkandyellow.com/tutorials/selectedTab/selectedTabDemo.html" target="_blank">here</a>.</p>
<p>By taking a closer look at the CSS you&#8217;ll see that the <em>page_item</em> and <em>current_page_item</em> classes have different styling. The remainder of the code is set up to make the button backgrounds expand and contract in accordance with the <a title="Sliding Door at AListApart.com" href="http://www.alistapart.com/articles/slidingdoors/" target="_blank">Sliding Doors technique from A List Apart</a>.The CSS code on the demo page is identical to the CSS code being used to style the page itself:</p>
<p><em>page_item</em> styles:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.page_item</span> a <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;img/right-over.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span> <span style="color: #933;">15px</span> <span style="color: #933;">7px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#DDDDDD</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">uppercase</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.page_item</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><em>current_page_item</em> styles:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.current_page_item</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;img/left-selected.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> 0 0 0 <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.current_page_item</span> a<span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.current_page_item</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;img/right-selected.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span> <span style="color: #933;">15px</span> <span style="color: #933;">7px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#C7532D</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">uppercase</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>If you already have your menu up and running properly, all you need to do is style these two classes and you&#8217;ll automatically have the current page highlighted in your menu. But this only applies to dynamic menus generated by WordPress. What happens when you hard code your menus yourself?</p>
<h4>Assign dynamic styles to hard-coded menus</h4>
<p>To get the same effect when you create a hard-coded menu you need to apply some clever PHP code to each of your menu items.</p>
<p>If you don&#8217;t understand what I mean by &#8220;hard-coded menu&#8221; consider this: By default your menu is called by a function within WordPress that lists all of your pages plus the Home page. This call usually looks something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php wp_list_pages<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'title_li=&amp;depth=1'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span></pre></div></div>

<p>But this function lists all your pages. If  you only want certain pages listed you have to take this function out and create a manual list yourself. This is a hard-coded menu.</p>
<p>To make the <em>current_page_item</em> class apply only to the current page item you need to add a small piece of PHP to each of your menu items. This line of code looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>is_page<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'home'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> echo <span style="color: #ff0000;">&quot;current_page_item&quot;</span>; <span style="color: #66cc66;">&#125;</span>?&gt;</span></pre></div></div>

<p>and is applied inside the <em>li</em> tag of each item. To give a concrete example I have added this code to the list items in the list example at the beginning of this tutorial:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item &lt;?php if (is_page('home')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com&quot;</span>&gt;</span>home<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-9 &lt;?php if (is_page('Lesson Files')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Lesson Files&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/lesson-files/&quot;</span>&gt;</span>Lesson Files<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-11 &lt;?php if (is_page('About the Author')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;About the Author&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/about-the-author/&quot;</span>&gt;</span>About the Author<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-13 &lt;?php if (is_page('FAQ')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;FAQ&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/faq/&quot;</span>&gt;</span>FAQ<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-15 &lt;?php if (is_page('Further Reading')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Further Reading&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/further-reading/&quot;</span>&gt;</span>Further Reading<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-17 &lt;?php if (is_page('Contact')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Contact&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/contact/&quot;</span>&gt;</span>Contact<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>When the page is loaded the PHP script looks to see if the page name matches the name in the <em>is_page</em> section and if it does, the <em>current_page_item</em> class is applied. Therefore the name you put in the <em>is_page</em> section of the PHP script must match the name of the page as created in WordPress exactly. If it does, the current page item will be highlighted dynamically.</p>
<blockquote><p>I have published an updated tutorial on this topic entitled <a href="http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/" title="Highlight Current Page or Category in WordPress 3.0 Menus">Highlight Current Page or Category in WordPress 3.0 Menus</a>. <a href="http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/" title="Highlight Current Page or Category in WordPress 3.0 Menus">Click here</a> to read the new article.</p></blockquote>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/' rel='bookmark' title='Permanent Link: Highlight Current Page or Category in WordPress 3.0 Menus'>Highlight Current Page or Category in WordPress 3.0 Menus</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/new-wordpress-based-site-the-readers-companion-20081002/' rel='bookmark' title='Permanent Link: New WordPress based site: The Reader&#8217;s Companion'>New WordPress based site: The Reader&#8217;s Companion</a></li>
<li><a href='http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-20081106/' rel='bookmark' title='Permanent Link: Create a Twitter box in your sidebar'>Create a Twitter box in your sidebar</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Read my article in the Microsoft Expression November Newsletter</title>
		<link>http://www.designisphilosophy.com/microsoft-expression-web/read-my-article-in-the-microsoft-expression-november-newsletter-20081118/</link>
		<comments>http://www.designisphilosophy.com/microsoft-expression-web/read-my-article-in-the-microsoft-expression-november-newsletter-20081118/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 20:26:18 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Expression Web]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[drop-down]]></category>
		<category><![CDATA[expression web]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=186</guid>
		<description><![CDATA[A month or so ago Microsoft contacted me and asked if I would write an article on Expression Web for their Expression Newsletter. How could I say no to such an opportunity? After some back and forth about the topic I landed on an article on how to create a Pure CSS Drop-Down menu. Over [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/pure-css-drop-down-menu-tutorial-a-slight-omission-20081121/' rel='bookmark' title='Permanent Link: Pure CSS Drop-Down Menu tutorial &#8211; a slight omission'>Pure CSS Drop-Down Menu tutorial &#8211; a slight omission</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/how-expression-web-2-creates-css-20080624/' rel='bookmark' title='Permanent Link: How Expression Web 2 Creates CSS'>How Expression Web 2 Creates CSS</a></li>
<li><a href='http://www.designisphilosophy.com/news/my-book-is-featured-in-the-canadian-user-experience-blog-20081201/' rel='bookmark' title='Permanent Link: My book is featured in the Canadian User Experience Blog'>My book is featured in the Canadian User Experience Blog</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://expression.microsoft.com/en-us/dd279540.aspx"><img class="alignleft" title="CSS Based Horizontal Drop-Down Menu" src="http://i.expression.microsoft.com/dd279538.css_menus_fp(en-us,MSDN.10).jpg" alt="" width="210" height="130" /></a>A month or so ago Microsoft contacted me and asked if I would write an article on Expression Web for their Expression Newsletter. How could I say no to such an opportunity? After some back and forth about the topic I landed on an article on <a title="The No-Code Way to a Pure CSS Horizontal Drop-Down Menu with Expression Web" href="http://expression.microsoft.com/en-us/dd279540.aspx" target="_blank">how to create a Pure CSS Drop-Down menu</a>. Over time I&#8217;ve encountered numerous solutions, most of which were clunky and didn&#8217;t work properly. So the tutorial demonstrates how to create a fully functional CSS-only drop-down menu utilizing the excellent CSS features in Expression Web.</p>
<p>That&#8217;s not to say you have to use Expression Web to get something out of the article though. You can follow the tutorial and get the same results even if you&#8217;re using Notepad to build your sites. It&#8217;s just that Expression Web makes it a hell of a lot easier to manage.</p>
<p><a href="http://tinyurl.com/styexpressionweb2"><img class="alignright" title="Sams Teach Yourself Microsoft Expression Web in 24 Hours" src="http://blog.pinkandyellow.com/wp-content/uploads/2008/06/styexpression.jpg" alt="" width="183" height="238" /></a>This article comes hot on the heels of my book <a title="Teach Yourself Expression Web 2 in 24 Hours" href="http://tinyurl.com/styexpressionweb2" target="_blank">Sams Teach Yourself Microsoft Expression Web 2 in 24 Hours</a> which contains an expanded tutorial on the same topic that also covers a layers-based drop-down menu. If you are an Expression Web 2 user of if you are considering buying or switching over to this excellent web authoring and publishing platform I humbly suggest you <a title="Get Teach Yourself Expression Web 2 in 24 Hours from Amazon.com" href="http://tinyurl.com/styexpressionweb2" target="_blank">pick up a copy for yourself</a>. It&#8217;s a quick read and it gives you hour-by-hour instructions on how to create a web site from scratch with the application. And once you&#8217;re done, you&#8217;ll have a fully working and standards based web site at your disposal. I wrote it as the book I wish someone had written when I started out and from the response I&#8217;ve gotten so far people are learning a lot from it. Which is what I set out to do.</p>
<p>If you&#8217;re interested in a preview of the kind of content you&#8217;ll find in the book or you just want to know <a title="The No-Code Way to a Pure CSS Horizontal Drop-Down Menu with Expression Web" href="http://expression.microsoft.com/en-us/dd279540.aspx" target="_blank">how to make a Pure CSS Drop-Down menu</a>, you can <a title="The No-Code Way to a Pure CSS Horizontal Drop-Down Menu with Expression Web" href="http://expression.microsoft.com/en-us/dd279540.aspx" target="_blank">read the full article, The No-Code Way to a Pure CSS Horizontal Drop-Down Menu with Expression Web, here</a> or <a title="Subscribe to the Expression Web Newsletter" href="https://profile.microsoft.com/RegSysProfileCenter/wizard.aspx?wizid=b62e5f03-3188-474a-a5f4-ff0116a3ccaa&amp;lcid=1033" target="_blank">subscribe to the Expression Web Newsletter</a>.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/pure-css-drop-down-menu-tutorial-a-slight-omission-20081121/' rel='bookmark' title='Permanent Link: Pure CSS Drop-Down Menu tutorial &#8211; a slight omission'>Pure CSS Drop-Down Menu tutorial &#8211; a slight omission</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/how-expression-web-2-creates-css-20080624/' rel='bookmark' title='Permanent Link: How Expression Web 2 Creates CSS'>How Expression Web 2 Creates CSS</a></li>
<li><a href='http://www.designisphilosophy.com/news/my-book-is-featured-in-the-canadian-user-experience-blog-20081201/' rel='bookmark' title='Permanent Link: My book is featured in the Canadian User Experience Blog'>My book is featured in the Canadian User Experience Blog</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/microsoft-expression-web/read-my-article-in-the-microsoft-expression-november-newsletter-20081118/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Create a Twitter Box in Your Sidebar &#8211; Part II</title>
		<link>http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-part-ii-20081113/</link>
		<comments>http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-part-ii-20081113/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 00:23:32 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=178</guid>
		<description><![CDATA[My Sidebar Twitter box tutorial seems to have struck a chord with WordPress users and it has generated some interesting questions. One of them, from TheNext2ShineBlog posed an interesting problem I decided to look into in more detail: the only thing I would like to change is the time aspect (23 days ago // 4 [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-20081106/' rel='bookmark' title='Permanent Link: Create a Twitter box in your sidebar'>Create a Twitter box in your sidebar</a></li>
<li><a href='http://www.designisphilosophy.com/news/twitter-sucks-20080628/' rel='bookmark' title='Permanent Link: Twitter Sucks!'>Twitter Sucks!</a></li>
<li><a href='http://www.designisphilosophy.com/twitter/twitter-force-follow-exploit-makes-us-all-friendless-20100510/' rel='bookmark' title='Permanent Link: Twitter force-follow exploit makes us all friendless'>Twitter force-follow exploit makes us all friendless</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://blog.pinkandyellow.com/css/create-a-twitter-box-in-your-sidebar-20081106" title="Create a Twitter Box in Your Sidebar - the original tutorial" target="_blank">Sidebar Twitter box tutorial</a> seems to have struck a chord with WordPress users and it has generated some interesting questions. One of them, from <a href="http://blog.thenext2shine.com/" title="The Next 2 Shine Blog" target="_blank">TheNext2ShineBlog</a> posed <a title="The original comment" href="http://blog.pinkandyellow.com/css/create-a-twitter-box-in-your-sidebar-20081106/#comment-19731" target="_blank">an interesting problem</a> I decided to look into in more detail:</p>
<blockquote><p>the only thing I would like to change is the time aspect (23 days ago // 4 hours ago). Is there a css code to hide that link without taking away the links from the original twitter message?</p></blockquote>
<p>What TheN2S is refering to is the tail end of each Twitter message that reads either &#8220;less than a minute ago&#8221;, &#8220;a few minutes ago&#8221; etc up to &#8220;X days ago&#8221;.</p>
<p>Careful inspection of the JavaScript that generates the Tweets for the application (<a title="Twitter's Blogger JS" href="http://twitter.com/javascripts/blogger.js" target="_blank">found here</a>) shows that the time information is a core function of the Twitter system so it is coded into the main structure of the application itself. Therefore it is hard to siply remove it unless you want to create your own custom JS. But TheN2S is on the right track in asking if it can be removed by way of CSS.</p>
<p>Lifting a random tweet off my own site I found that the main body the JS spits out is contained within a <em>span</em> tag while the tail end with the time info is not:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
   <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;</span>@<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.twitter.com/webb_art&quot;</span>&gt;</span>webb_art<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> DropBox works well for me and is platform independent: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.getdropbox.com/&quot;</span>&gt;</span>	http://www.getdropbox.com/<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
   <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/mor10/statuses/1003495851&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;font-size: 85%;&quot;</span>&gt;</span> about 15 hours ago<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span></pre></div></div>

<p>That means we can use CSS to hide the content <em>not</em> in the <em><span></em> while maintaining the visibility of the content that is. That requires some additions to the original CSS code:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#twitter_div</span> ul li span <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">visibility</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">visible</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#twitter_div</span> ul li span a <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#D78E42</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">visibility</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">visible</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#twitter_div</span> ul li a <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">visibility</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The first two single out the regular and link contents within the <em>span</em> specifically and set their visibility to visible. This is done because the last style sets the visibility of all anchors within list items under the <em>twitter_div</em> ID to hidden. So we are really working backwards &#8211; first hiding everything and then unhiding it in particular cases.</p>
<p>By adding these three style elements the time information will be hidden by the CSS while everything else shows up normally.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-20081106/' rel='bookmark' title='Permanent Link: Create a Twitter box in your sidebar'>Create a Twitter box in your sidebar</a></li>
<li><a href='http://www.designisphilosophy.com/news/twitter-sucks-20080628/' rel='bookmark' title='Permanent Link: Twitter Sucks!'>Twitter Sucks!</a></li>
<li><a href='http://www.designisphilosophy.com/twitter/twitter-force-follow-exploit-makes-us-all-friendless-20100510/' rel='bookmark' title='Permanent Link: Twitter force-follow exploit makes us all friendless'>Twitter force-follow exploit makes us all friendless</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-part-ii-20081113/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>CSS Gallery Features</title>
		<link>http://www.designisphilosophy.com/news/css-gallery-features-20081107/</link>
		<comments>http://www.designisphilosophy.com/news/css-gallery-features-20081107/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 22:55:18 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[gallery]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=142</guid>
		<description><![CDATA[After three days in it&#8217;s new incarnation, Design is Philosophy is being featured in a myriad of CSS and web galleries. this in turn caused an insane spike in readership that makes my stats page look pretty weird. I haven&#8217;t had time to track back all the postings yet so I&#8217;ll keep adding on to [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/news/2008-weblog-awards-finalist-20090102/' rel='bookmark' title='Permanent Link: 2008 Weblog Awards Finalist'>2008 Weblog Awards Finalist</a></li>
<li><a href='http://www.designisphilosophy.com/news/best-of-604-nominations-20081204/' rel='bookmark' title='Permanent Link: Best of 604 Nominations'>Best of 604 Nominations</a></li>
<li><a href='http://www.designisphilosophy.com/news/design-is-philosophy-featured-at-webdesigner-depot-20081219/' rel='bookmark' title='Permanent Link: Design is Philosophy featured at Webdesigner Depot'>Design is Philosophy featured at Webdesigner Depot</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After three days in it&#8217;s new incarnation, <a title="Design is Philosophy - the Pink &amp; Yellow Media Blog" href="http://blog.pinkandyellow.com" target="_blank">Design is Philosophy</a> is being featured in a myriad of CSS and web galleries. this in turn caused an insane spike in readership that makes my stats page look pretty weird. I haven&#8217;t had time to track back all the postings yet so I&#8217;ll keep adding on to this list in the coming days. Anyways, here is an incomplete list with big thanks to the galleries for featuring me and all the people who vote for my site (yes, you should vote too):</p>
<ul>
<li><a title="Design is Philosophy at CSSMania" href="http://cssmania.com/galleries/2008/11/07/design-is-philosophy.php" target="_blank">CSS Mania</a></li>
<li><a title="Design is Philosophy at CSSBased" href="http://www.cssbased.com/showcase/4243/design-is-philosophy" target="_blank">CSS Based</a></li>
<li><a title="Design is Philosophy at CSSSnap" href="http://csssnap.com/design-is-philosophy/" target="_blank">CSS Snap</a></li>
<li><a title="Design is Philosophy at CSS Container" href="http://csscontainer.com/view.php?id=4445" target="_blank">CSS Container</a></li>
<li><a title="Design is Philosophy at OneCSS" href="http://www.onecss.com/2008/11/07/design-is-philosophy/" target="_blank">One CSS</a></li>
<li><a title="Design is Philosophy at CSSChick" href="http://www.csschick.com/1090_design-is%C2%A0philosophy/" target="_blank">CSS Chick</a></li>
<li><a title="Design is Philosophy at CSSLeak" href="http://www.cssleak.com/detail-Design_is_Philosophy-3395.html" target="_blank">CSS Leak</a></li>
<li><a title="Design is Philosophy at Most Inspired" href="http://www.mostinspired.com/sites/view/fb920bc5ad28280a5722f2d2fd1472c8" target="_blank">Most Inspired</a></li>
<li><a title="Design is Philosophy on CSS Brigit" href="http://cssbrigit.com/website/2008110701024630" target="_blank">CSS Brigit</a></li>
<li><a title="Design is Philosophy at CSSMix" href="http://www.cssmix.nl/website/Design-is-Philosophy.html" target="_blank">CSS Mix</a></li>
<li><a title="Design is Philosophy at We Love WP" href="http://welovewp.com/design-is-philosophy.html" target="_blank">WeLoveWP</a></li>
<li><a title="Design is Philosophy at RGB Garden" href="http://www.rgbgarden.com/content/design-philosophy" target="_blank">RGB Garden</a></li>
<li><a title="Design is Philosophy at CSS Breeze" href="http://www.cssbreeze.com/design-is-philosophy/" target="_blank">CSS Breeze</a></li>
<li><a title="CSS Season" href="http://www.cssseason.com/" target="_blank">CSS Season</a></li>
</ul>
<p>Feel free to submit this site to other CSS and web galleries if you like. And a big thanks to those of you who allready have.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/news/2008-weblog-awards-finalist-20090102/' rel='bookmark' title='Permanent Link: 2008 Weblog Awards Finalist'>2008 Weblog Awards Finalist</a></li>
<li><a href='http://www.designisphilosophy.com/news/best-of-604-nominations-20081204/' rel='bookmark' title='Permanent Link: Best of 604 Nominations'>Best of 604 Nominations</a></li>
<li><a href='http://www.designisphilosophy.com/news/design-is-philosophy-featured-at-webdesigner-depot-20081219/' rel='bookmark' title='Permanent Link: Design is Philosophy featured at Webdesigner Depot'>Design is Philosophy featured at Webdesigner Depot</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/news/css-gallery-features-20081107/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create a Twitter box in your sidebar</title>
		<link>http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-20081106/</link>
		<comments>http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-20081106/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 03:44:39 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=130</guid>
		<description><![CDATA[As part of the new design for this blog I added a Twitter box in the sidebar. There are hundreds of WordPress plugins that do this for you but they are all quite involved and they bog down the blog unnecessarily. Much easier to just hard code the box into your blog yourself. It&#8217;s actually [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-part-ii-20081113/' rel='bookmark' title='Permanent Link: Create a Twitter Box in Your Sidebar &#8211; Part II'>Create a Twitter Box in Your Sidebar &#8211; Part II</a></li>
<li><a href='http://www.designisphilosophy.com/tutorials/build-a-fancy-wordpress-author-box-20100507/' rel='bookmark' title='Permanent Link: Build a fancy WordPress author box'>Build a fancy WordPress author box</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/selected-pages-an-answer-for-beal-20080111/' rel='bookmark' title='Permanent Link: Selected Pages &#8211; an answer for Beal'>Selected Pages &#8211; an answer for Beal</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.pinkandyellow.com/wp-content/uploads/2008/11/twitterbox.jpg"><img src="http://blog.pinkandyellow.com/wp-content/uploads/2008/11/twitterbox.jpg" alt="" title="My fancy Twitter box" width="360" height="158" class="alignleft size-full wp-image-131" /></a>As part of the new design for this blog I added a Twitter box in the sidebar. There are hundreds of WordPress plugins that do this for you but they are all quite involved and they bog down the blog unnecessarily. Much easier to just hard code the box into your blog yourself. It&#8217;s actually surprisingly easy to do, but the code that Twitter provides is a bit wonky (and shockingly it doesn&#8217;t validate!).</p>
<p>In this tutorial you&#8217;ll learn how to easily create a fancy box that displays your latest Twitter rants in your sidebar without having to turn to clunky plug-ins that bog your blog down.</p>
<h4>Get your Twitter Badge</h4>
<p>To start off with you need your Twitter Badge. This is the official Twitter JavaScript that passes your latest tweets to wherever you want. You can get your badge at <a title="Get your Twitter Badge" href="http://twitter.com/badges" target="_blank">twitter.com/badges</a>. Twitter has custom badges for MySpace, Blogger, Facebook and TypePad but surprisingly nothing for WordPress. That doesn&#8217;t really matter because it&#8217;s actually easier to just make one of your own.</p>
<p>Select <strong>Other</strong> and you are taken to page two which presents three options:</p>
<ol>
<li>Flash (Just Me) &#8211; hideous</li>
<li>Flash with Friends &#8211; even more hideous</li>
<li>HTML/JavaScript &#8211; great for people with eyes</li>
</ol>
<p>Select the last option (HTML/JavaScript) and you are taken to page 3 where you can customize the code by defining how many tweets you want and what the Badge title should be. I chose 2 tweets and turned the title off. This provided me with the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;twitter_div&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;twitter_update_list&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/javascripts/blogger.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/statuses/user_timeline/mor10.json?callback=twitterCallback2&amp;amp;count=2&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p>(This code will of course differ depending on your settings.)</p>
<p>Paste the code in wherever you want on your site or your blog.</p>
<h4>Style your Badge</h4>
<p>The Twitter Badge comes equipped with JavaScript that injects the tweets into your badge in the form of unordered list items as well as built in style elements. They are: <i>#twitter_div</i> (styles the badge wrap), <i>.sidebar_title</i> (styles the title) and <i>#twitter_update_list</i> (styles the unordered list).</p>
<p>Before you start styling, you have to fix the generated code to make it validate. Since it is the JavaScript that actually generates the list items, browsers and validators get all cranky about the code because there are no list items within the unordered list in the markup itself. Therefore you need to insert an empty list item just to please the W3C gods:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;twitter_div&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;twitter_update_list&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/javascripts/blogger.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/statuses/user_timeline/mor10.json?callback=twitterCallback2&amp;amp;count=2&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p>Once that&#8217;s settled you can start styling your elements. Again because of the JavaScript you have to stick with the names Twitter provides, but that shouldn&#8217;t cause any problems. For my Twitter Badge I created a background PNG much larger than what I actually needed to accommodate a future situation where I would add more than 2 tweets at a time (which you can see by <a href="http://blog.pinkandyellow.com/wp-content/themes/DesignIsPhilosophy/img/twitterBG.png" title="The twitter box background" target="image">clicking here</a>). The background graphic is cut off by a matching blue bottom border. The whole style package looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#twitter_div</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'img/twitterBG.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom-width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#5AA5BC</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0.9em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#twitter_div</span> ul li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#0C93BA</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom-width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#A1E8F7</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#twitter_div</span> ul li a <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#DDA84E</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#twitter_div</span> ul li a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#D78E42</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#twitter_div</span> p <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h4>Add a link for future followers</h4>
<p>The observant reader will notice that there&#8217;s still one element missing: The Follow me on Twitter link in the bottom right corner. That&#8217;s the reason for the p style in the CSS code as well. So with the follow link, the final HTML markup looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!-- TWITTER --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;twitter_div&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;twitter_update_list&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/mor10&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Follow me on Twitter&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Twitter&quot;</span>&gt;</span>Follow me on Twitter<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/javascripts/blogger.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/statuses/user_timeline/mor10.json?callback=twitterCallback2&amp;amp;count=2&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!-- END TWITTER --&gt;</span></pre></div></div>

<p>And with that you have a fancy Twitter box you can put in your sidebar without bogging your blog down with plug-ins.</p>
<p>Read the <a href="http://blog.pinkandyellow.com/css/create-a-twitter-box-in-your-sidebar-part-ii-20081113/" title="Create a Twitter Box in Your Sidebar - Part II" target="_blank">second half of this tutorial</a>, in which you learn how to hide the time stamp at the tail end of the Tweets.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-part-ii-20081113/' rel='bookmark' title='Permanent Link: Create a Twitter Box in Your Sidebar &#8211; Part II'>Create a Twitter Box in Your Sidebar &#8211; Part II</a></li>
<li><a href='http://www.designisphilosophy.com/tutorials/build-a-fancy-wordpress-author-box-20100507/' rel='bookmark' title='Permanent Link: Build a fancy WordPress author box'>Build a fancy WordPress author box</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/selected-pages-an-answer-for-beal-20080111/' rel='bookmark' title='Permanent Link: Selected Pages &#8211; an answer for Beal'>Selected Pages &#8211; an answer for Beal</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-20081106/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
	</channel>
</rss>
