<?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>fuzzymargins &#187; Design</title>
	<atom:link href="http://www.fuzzymargins.com/category/design/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fuzzymargins.com</link>
	<description>Life is full of code</description>
	<lastBuildDate>Sun, 07 Mar 2010 14:21:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Move the WordPress pages to the header &#8211; revisited</title>
		<link>http://www.fuzzymargins.com/2010/01/move-the-wordpress-pages-to-the-header-revisited/</link>
		<comments>http://www.fuzzymargins.com/2010/01/move-the-wordpress-pages-to-the-header-revisited/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 20:42:26 +0000</pubDate>
		<dc:creator>jamespiggot</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.fuzzymargins.com/?p=332</guid>
		<description><![CDATA[This updated article describes how to use the page widget to build a page menu in the WordPress header. For the background to this see the previous post Move the WordPress page links to the header that described a simple way of listing the page links on the header. This method makes use of the [...]]]></description>
			<content:encoded><![CDATA[<p>This updated article describes how to use the page widget to build a page menu in the WordPress header. For the background to this see the previous post <a href="http://www.fuzzymargins.com/2009/04/move-the-wordpress-page-links-to-the-header/">Move the WordPress page links to the header</a> that described a simple way of listing the page links on the header.<br />
<span id="more-332"></span><br />
This method makes use of the Pages widget which allows pages to be excluded from the menu and also allows the sort order of the pages to be specified. To view this from the dashboard expand Appearance in the left-hand sidebar then select Widgets. You can then use the Widget to set up a list of page links in the sidebar.</p>
<p><img src="http://www.fuzzymargins.com/wp-content/uploads/2010/01/Widgets_Pages.gif" alt="WordPress Pages widget" title="WordPress Pages widget" width="252" height="243" class="alignnone size-full wp-image-195" /></p>
<p>The first thing is to find the path to the theme that you are using, for the default theme the path is:</p>
<p class="highlight">&frasl;wordpress&frasl;wp-content&frasl;themes&frasl;default</p>
<p>For other themes the path will vary so make sure you have identified the correct one for the theme you have in use. </p>
<p>Then using your favourite text editor open up the following files:</p>
<ul>
<li><strong>functions.php</strong></li>
<li><strong>header.php</strong></li>
</ul>
<p class="note"><strong>Note:</strong> Before you make any changes to these files make sure you have a backup</p>
<p>In functions.php add the following code in an appropriate place. </p>
<pre><code>function list_pages($pages) {
$options = get_option( 'widget_pages' );
foreach ($options as $key=&gt;$value) {
        if ( $pages == $options[$key]['title'])	{
			$sortby = $options[$key]['sortby'];
			$exclude = $options[$key]['exclude'];
        	if ( $sortby == 'menu_order' ) {
				$sortby = 'menu_order, post_title';
				}
			$out = wp_list_pages( apply_filters('widget_pages_args',
					array('title_li' =&gt; '',
					'echo' =&gt; 0,
					'sort_column' =&gt; $sortby,
					'exclude' =&gt; $exclude) ) );
        	if ( !empty( $out ) ) {
				?&gt;
				&lt;li&gt;&lt;?php echo $out; ?&gt;&lt;/li&gt;
				&lt;?php
				}
        	}
		}
}</code></pre>
<p>Then add the following line of code in the <em>header.php</em> file. The correct location will vary by theme but generally it will be within the <em>header div</em>.</p>
<pre><code>&lt;ul&gt;&lt;?php list_pages('Header1'); ?&gt;&lt;/ul&gt;</code>
</pre>
<p>The effect of this will be to list the pages defined by the Pages widget that has a title of <em>Header1</em>, you can edit the the parameter above for list_pages to match the one you are already using. This should work with WordPress 2.8 onwards but probably will not work with previous versions to that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fuzzymargins.com/2010/01/move-the-wordpress-pages-to-the-header-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Move the WordPress page links to the header</title>
		<link>http://www.fuzzymargins.com/2009/04/move-the-wordpress-page-links-to-the-header/</link>
		<comments>http://www.fuzzymargins.com/2009/04/move-the-wordpress-page-links-to-the-header/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 13:30:36 +0000</pubDate>
		<dc:creator>jamespiggot</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.fuzzymargins.com/?p=289</guid>
		<description><![CDATA[The default theme for WordPress places the links to pages in the sidebar. Moving them to the header is relatively easy to do if you&#8217;re comfortable making minor changes to the code. The first thing is to find the path to the theme that you are using, for the default theme the path is: &#8260;wordpress&#8260;wp-content&#8260;themes&#8260;default [...]]]></description>
			<content:encoded><![CDATA[<p>The default theme for WordPress places the links to pages in the sidebar. Moving them to the header is relatively easy to do if you&#8217;re comfortable making minor changes to the code.<br />
The first thing is to find the path to the theme that you are using, for the default theme the path is:</p>
<p class="highlight">&frasl;wordpress&frasl;wp-content&frasl;themes&frasl;default</p>
<p>For other themes the path will vary so make sure you have identified the correct one for the theme you have in use. </p>
<p>Then using your favourite text editor open up the following files:</p>
<ul>
<li><strong>sidebar.php</strong></li>
<li><strong>header.php</strong></li>
</ul>
<p class="note"><strong>Note:</strong> Before you make any changes to these files make sure you have a backup</p>
<p>Next look for the following code fragment in sidebar.php which is used by WordPress to generate the list of page links.</p>
<p><span id="more-289"></span></p>
<pre><code>&lt;ul&gt;&lt;?php wp_list_pages('title_li='); ?&gt;&lt;/ul&gt;</code>
</pre>
<p>Copy the line of code above from the <em>sidebar.php</em> file and paste it in to the <em>header.php</em> file</p>
<p>This will copy the page links from the sidebar to the header. The end result may look strange because of the CSS styles in use. To get the result seen above in the header of this blog I changed the stylesheet to make the page links float right, where you place them  is down to personal preferences.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fuzzymargins.com/2009/04/move-the-wordpress-page-links-to-the-header/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Move the WordPress search box to the header</title>
		<link>http://www.fuzzymargins.com/2009/04/move-the-wordpress-search-box-to-the-header/</link>
		<comments>http://www.fuzzymargins.com/2009/04/move-the-wordpress-search-box-to-the-header/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 17:14:02 +0000</pubDate>
		<dc:creator>jamespiggot</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.fuzzymargins.com/?p=237</guid>
		<description><![CDATA[The default theme in WordPress places the search box in the sidebar. Moving it to the header is relatively easy to do if you&#8217;re comfortable making minor changes to the code. The first thing is to find the path to the theme that you are using, for the default theme the path is: &#8260;wordpress&#8260;wp-content&#8260;themes&#8260;default Then [...]]]></description>
			<content:encoded><![CDATA[<p>The default theme in WordPress places the search box in the sidebar. Moving it to the header is relatively easy to do if you&#8217;re comfortable making minor changes to the code. The first thing is to find the path to the theme that you are using, for the default theme the path is:</p>
<p class="highlight">&frasl;wordpress&frasl;wp-content&frasl;themes&frasl;default</p>
<p>Then using your favourite text editor open up the following files:</p>
<ul>
<li><strong>sidebar.php</strong></li>
<li><strong>header.php</strong></li>
</ul>
<p class="note"><strong>Note:</strong> Before you make any changes to these files make sure you have a backup</p>
<p>Next look for the following code fragment in sidebar.php which is used by WordPress to generate the search box (What this code does is to insert the contents of the <em>searchform.php </em>file at this point in the page. The <em>searchform.php</em> file contains the code to produce the search box and the search button).</p>
<p><span id="more-237"></span></p>
<pre><code>&lt;?php include (TEMPLATEPATH . '/searchform.php'); ?&gt;</code>
</pre>
<p>Cut the line of code above from the <em>sidebar.php</em> file and paste it in an appropriate location in the header.php file.</p>
<p>This will move the search form from the sidebar to the header. The end result may look strange because of the CSS styles in use. To get the result seen above in the header of this blog I changed the stylesheet to make the title float left and the search form float right, where you place the search form is down to personal preferences.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fuzzymargins.com/2009/04/move-the-wordpress-search-box-to-the-header/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Cross-browser and platform compatibility</title>
		<link>http://www.fuzzymargins.com/2008/11/cross-browser-and-platform-compatibility/</link>
		<comments>http://www.fuzzymargins.com/2008/11/cross-browser-and-platform-compatibility/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 08:59:01 +0000</pubDate>
		<dc:creator>jamespiggot</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[html compatibility]]></category>

		<guid isPermaLink="false">http://www.fuzzymargins.com/?p=21</guid>
		<description><![CDATA[How do you test your pages to ensure they don&#8217;t look awful on another platform? How do you make sure your carefully crafted pages don&#8217;t fall to pieces when viewed with Safari on Mac OS or collapse in a heap under MSIE 5.0 for Windows? You can maintain multiple operating systems and perhaps run emulations [...]]]></description>
			<content:encoded><![CDATA[<h3>How do you test your pages to ensure they don&#8217;t look awful on another platform?</h3>
<p>How do you make sure your carefully crafted pages don&#8217;t fall to pieces when viewed with Safari on Mac OS or collapse in a heap under MSIE 5.0 for Windows?</p>
<p>You can maintain multiple operating systems and perhaps run emulations or virtual machines but it all can be very time consuming and troublesome.<br />
<span id="more-21"></span><br />
So stumbling across <a title="Browsershots.org" href="http://browsershots.org/" target="_blank">Browsershots </a>seemed to offer a solution to all these issues, you submit your URL and it comes back with screenshots of your webpage for a wide variety of browser and platform combinations.</p>
<p>In their own words what it offers is to:</p>
<blockquote><p>Browsershots makes screenshots of your web design in different browsers. It is a free open-source online service created by Johann C. Rocholl. When you submit your web address, it will be added to the job queue. A number of distributed computers will open your website in their browser. Then they will make screenshots and upload them to the central server here.</p></blockquote>
<p>Having used it for a while, and found various horrors lurking in what looked like perfectly viable designs, I can thoroughly recommend this service, and best of all it is free, although if you find it useful you can pay for priority processing. You may have to wait a few minutes for the screenshots to be captured and listed on the page, but that is worth it if like me you don&#8217;t can&#8217;t afford the various paid services or the cost of having a complete test suite.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fuzzymargins.com/2008/11/cross-browser-and-platform-compatibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Style columns in tables with CSS</title>
		<link>http://www.fuzzymargins.com/2008/10/style-columns-in-tables-with-css/</link>
		<comments>http://www.fuzzymargins.com/2008/10/style-columns-in-tables-with-css/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 21:27:44 +0000</pubDate>
		<dc:creator>jamespiggot</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.fuzzymargins.com/?p=4</guid>
		<description><![CDATA[How do you style columns in HTML tables without resorting to styling the individual cells? There doesn&#8217;t seem to be an easy answer to this question that will work with most browsers. The method shown here works fine for my requirements but that&#8217;s not to say there aren&#8217;t better ways of doing this out there. [...]]]></description>
			<content:encoded><![CDATA[<h3>How do you style columns in HTML tables without resorting to styling the individual cells?</h3>
<p>There doesn&#8217;t seem to be an easy answer to this question that will work with most browsers. The method shown here works fine for my requirements but that&#8217;s not to say there aren&#8217;t better ways of doing this out there.</p>
<p>The requirement I had was for a restaurant that required a table with three columns; the text of the menu item, special colour characters for vegetarian or wheat free dishes,  and the price of the item. The image below shows an example of the menu.</p>
<p><a href="http://www.fuzzymargins.com/wp-content/uploads/2008/11/menu_test1.png"><img class="alignnone size-full wp-image-17" title="menu_test1" src="http://www.fuzzymargins.com/wp-content/uploads/2008/11/menu_test1.jpg" alt="" width="500" height="183" /></a></p>
<p>The text column is left aligned text with a width of 85%. The second column is centre aligned with a width of 5%.  The third column with the price has to be horizontally right-aligned, vertically top aligned, with bold text and a width of 10%.</p>
<p><span id="more-4"></span></p>
<p>There are several ways of doing this, one approach is to style each cell in the column but the resulting code is not easily changed and can be very tedious for tables with a large number of cells, plus it is going back to using tables for presentation</p>
<p>An alternative approach is to use pure CSS by constructing the table with &lt;div>tags and not using html table markup at all. This works but does result in divitis with loads of nested div tags.</p>
<p>The best solution I&#8217;ve found, and no doubt there are others as good or better out there,  is to use the <em>:first-child pseudo-class</em>.  This pseudo-class matches the first occurrence of the specified element within another element. You can request the first cell within each row in the table with the end result being a column.  So the the CSS  style sheet containing:</p>
<pre><code>div.menu_box td:first-child {
width: 85%
}</code></pre>
<p>Would result in the first column of the table having a width of 85% of the enclosing element, in this case the menu_box div.</p>
<p>To select the second column in the table just use the <em>adjacent sibling combinator </em>which is a plus symbol. This will select an element that immediately follows another element with the same parent,  in this case we select a  &lt;td> tag that immediately follows another &lt;td> tag when they are both children of the same menu_box div parent.</p>
<p>Adding this to the style sheet results in:</p>
<pre><code>div.menu_box td:first-child {
width: 85%;
}
div.menu_box td:first-child + td {
width: 5%; text-align: center;
}</code></pre>
<p>Following the same pattern, to make the third column right-aligned and bold we just need to add another adjacent sibling plus (+) sign and another td selector to give:</p>
<pre><code>div.menu_box td:first-child {
width: 85%;
}
div.menu_box td:first-child + td {
width: 5%; text-align: center;
}
div.menu_box td:first-child + td  + td {
width: 10%;
text-align: right;
font-weight:800;
vertical-align: top;
}</code></pre>
<p>This works with most modern browsers, but doesn&#8217;t work with IE 6 or previous.</p>
<p>That requires some extra CSS (shown in bold below) to make up for the fact that older versions of IE don&#8217;t have support the solution outlined above, but does have support for some non-standard attributes in the</p>
<p>tag (which the more modern standard-compliant browsers like FireFox do not support).  So to get something that works correctly with most browsers you have to use two different methods combined as shown below.</p>
<pre><code>div.menu_box <strong>col.c1</strong>, td:first-child {
width: 85%;
}
div.menu_box <strong>col.c2</strong>, td:first-child + td {
width: 5%; text-align: center;
vertical-align: top;
}
div.menu_box <strong>col.c3</strong>, td:first-child + td  + td {
width: 10%;
text-align: right;
font-weight:800;
vertical-align: top;
}</code></pre>
<p>The col.c1, col.c2 and col.c3 selectors are used within a  tag in the HTML table as shown below.</p>
<pre><code>&amp;lt;div class="menu_box"&gt;
&amp;lt;table border="0"&gt;
&amp;lt;colgroup&gt;
  &amp;lt;col class="c1"&gt;&amp;lt;/col&gt;
  &amp;lt;col class="c2"&gt;&amp;lt;/col&gt;
  &amp;lt;col class="c3"&gt;&amp;lt;/col&gt;
&amp;lt;/colgroup&gt;
...table rows and cells go here....
&amp;lt;/table&gt;
&amp;lt;/div&gt;</code>
</pre>
<p>To test browser compatibility I used the free service at <a title="Browser Shots " href="http://browsershots.org" target="_blank">http://browsershots.org</a> where you can test a page and receive images of the page for each platform/browser/version combination.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fuzzymargins.com/2008/10/style-columns-in-tables-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
