<?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>Advanced CSS Design Resources - last-child.com &#187; display</title>
	<atom:link href="http://www.last-child.com/category/css/display/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.last-child.com</link>
	<description>CSS Toys for Professional Web Developers</description>
	<lastBuildDate>Thu, 08 Jul 2010 16:59:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>A quick CSS3 sibling test with the video tag</title>
		<link>http://www.last-child.com/css3-sibling-with-video-tag/</link>
		<comments>http://www.last-child.com/css3-sibling-with-video-tag/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 15:56:31 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[:absolute]]></category>
		<category><![CDATA[:block]]></category>
		<category><![CDATA[:focus]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Siblings]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[position]]></category>

		<guid isPermaLink="false">http://www.last-child.com/?p=240</guid>
		<description><![CDATA[I am working on a little widget that uses the html5 video tag on one of my test sites: Fyvr.net. I wanted to display related information when the video is playing. The sibling selector makes this easy. Here&#8217;s the basic markup &#60;li> &#60;video>...&#60;/video> &#60;p>...&#60;/p> &#60;/li> I wanted the paragraph to appear when the video is [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on a little widget that uses the html5 video tag on one of my test sites: <a href="http://fyvr.net">Fyvr.net</a>.<br />
I wanted to display related information when the video is playing.  The sibling selector makes this easy. </p>
<p>Here&#8217;s the basic markup</p>
<pre><code lang="HTML">
&lt;li>
&lt;video>...&lt;/video>
&lt;p>...&lt;/p>
&lt;/li>
</code>
</pre>
<p>I wanted the paragraph to appear when the video is selected. So here&#8217;s the simple CSS</p>
<pre><code lang="CSS">
section#videolist li {
	position:relative;
}
section#videolist li p {
	display:none;
	position:absolute;
	bottom:-100px;
	left:0;
}
section#videolist li video:focus+p {
	display:block;
}
</code></pre>
<p>The sibling selector (+) is telling the browser to display the paragraph as block when its video brother has focus. This is a rough test. There could be some accessibility issues and I&#8217;ll need to test this out. Obviously this will not work in Internet Explorer. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/css3-sibling-with-video-tag/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick hint for using the YUI Container library</title>
		<link>http://www.last-child.com/quick-hint-for-using-the-yui-container-library/</link>
		<comments>http://www.last-child.com/quick-hint-for-using-the-yui-container-library/#comments</comments>
		<pubDate>Thu, 11 May 2006 14:24:17 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[Div]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[visibility]]></category>

		<guid isPermaLink="false">http://www.last-child.com/quick-hint-for-using-the-yui-container-library/</guid>
		<description><![CDATA[The YUI Container libraries work with visibility:hidden to hide your targeted div. I&#8217;ve spent too many hours trying to figure out why something wasn&#8217;t working only to realize I had display:none in the CSS. So, when you use these libraries remember visibility, not display. It&#8217;s a mantra that could keep you from pounding your forehead [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://developer.yahoo.com/yui/container/index.html">YUI Container libraries</a> work with <em>visibility:hidden</em> to hide your targeted div. I&#8217;ve spent too many hours trying to figure out why something wasn&#8217;t working only to realize I had <em>display:none</em> in the CSS. So, when you use these libraries remember visibility, not display.  It&#8217;s a mantra that could keep you from pounding your forehead into a keyboard repeatedly. </p>
<p>And don&#8217;t forget to keep your libraries updated!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/quick-hint-for-using-the-yui-container-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple medias in the print.css</title>
		<link>http://www.last-child.com/multiple-medias-in-the-printcss/</link>
		<comments>http://www.last-child.com/multiple-medias-in-the-printcss/#comments</comments>
		<pubDate>Wed, 29 Mar 2006 23:33:37 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[:block]]></category>
		<category><![CDATA[:none]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[media]]></category>

		<guid isPermaLink="false">http://www.last-child.com/multiple-medias-in-the-printcss/</guid>
		<description><![CDATA[Let&#8217;s say you have a printer-friendly page that consolidates information from multiple sections. The page uses the print.css as all instead of just print. Let&#8217;s also assume you want to show things on the screen, such as a link back to the referral page, and different elements on the printed page, such as the url [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you have a printer-friendly page that consolidates information from multiple sections.  The page uses the print.css as all instead of just print. Let&#8217;s also assume you want to show things on the screen, such as a link back to the referral page, and different elements on the printed page, such as the url of the referral page. </p>
<h3>Simple HTML Example</h3>
<p><code lang="HTML"></p>
<p class="noprint"><a href="/" onclick="javascript:history.go(-1); return:false;">Go back to the last page</a>.</p>
<p class="print">http://www.last-child.com/multiple-medias-in-the-print.css</p>
<p></code></p>
<h3>CSS solution</h3>
<p>You can include multiple medias in one style sheet. Just declare the special rules under @media</p>
<p><code lang="CSS"><br />
@media print{/*show printer only elements, hide screen only elements */<br />
.noprint {display:none;}<br />
.print {display:block;}<br />
 }<br />
</code></p>
<p>Your main CSS file would have already declared .print {display:none;}.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/multiple-medias-in-the-printcss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The perfect FAQ page ! &#8211; by Thierry Koblentz</title>
		<link>http://www.last-child.com/the-perfect-faq-page/</link>
		<comments>http://www.last-child.com/the-perfect-faq-page/#comments</comments>
		<pubDate>Mon, 27 Feb 2006 00:37:39 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[:block]]></category>
		<category><![CDATA[:none]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Definition List]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[display]]></category>

		<guid isPermaLink="false">http://www.last-child.com/the-perfect-faq-page/</guid>
		<description><![CDATA[&#8211; This was originally published on www.tjkdesign.com. Visit the original site for updated code and to see a working copy of the script. Thierry has created a Dreamweaver plugin to make this super-easy to add to your site! This is about using a Definition List and the DOM to create a nice FAQ page where [...]]]></description>
			<content:encoded><![CDATA[<p>&#8211; This was originally published on <a href="http://www.tjkdesign.com/articles/toggle_elements.asp">www.tjkdesign.com</a>. Visit the original site for updated code and to see a working copy of the script. Thierry has created a <a href="http://www.tjkdesign.com/articles/TJK_ToggleDL/extension/easyFAQ.asp">Dreamweaver plugin</a> to make this super-easy to add to your site!</p>
<p>This  is about using a <em>Definition List</em> and the <acronym title="Document Object Model">DOM</acronym> to create a nice <acronym title="Frequently Asked Questions">FAQ</acronym> page where clicking on the <acronym title="Definition Term">DT</acronym>s (the questions) &#8220;toggles&#8221;  the associated <acronym title="Definition Description">DD</acronym>s (the answers).</p>
<p class="smallText">Note: If you&#8217;re already using this solution, please check your version number (this is <span class="red">version 1.5.4</span>). Before you download the newest version I suggest to go through the entire article again (since a few things have changed).</p>
<p>This is what it does:</p>
<p><a id="TJK_ToggleON">Open All</a><a id="TJK_ToggleOFF">Close All</a></p>
<dl id="TJK_DL">
<dt>Question 1?</dt>
<dd>The vitality of conceptual synergies is of supreme importance exploiting the productive lifecycle working through a top-down, bottom-up approach. To focus on improvement, not cost, from binary cause and effect to complex patterns, while those at the coal face don&#8217;t have sufficient view of the overall goals.</dd>
<dt>Question 2?</dt>
<dd>To focus on improvement, not cost, from binary cause and effect to complex patterns, while those at the coal face don&#8217;t have sufficient view of the overall goals. To ensure that non-operating cash outflows are assessed.</dd>
<dt>Question 3?</dt>
<dd>The vitality of conceptual synergies is of supreme importance exploiting the productive lifecycle working through a top-down, bottom-up approach. To focus on improvement, not cost, from binary cause and effect to complex patterns, while those at the coal face don&#8217;t have sufficient view of the overall goals. To ensure that non-operating cash outflows are assessed. The vitality of conceptual synergies is of supreme importance exploiting the productive lifecycle working through a top-down, bottom-up approach.</dd>
<dt>Question 4?</dt>
<dd>The vitality of conceptual synergies is of supreme importance exploiting the productive lifecycle working through a top-down, bottom-up approach. To ensure that non-operating cash outflows are assessed.</dd>
<dt>Question 5?</dt>
<dd>The vitality of conceptual synergies is of supreme importance exploiting the productive lifecycle working through a top-down, bottom-up approach. To focus on improvement, not cost, from binary cause and effect to complex patterns, while those at the coal face don&#8217;t have sufficient view of the overall goals. To ensure that non-operating cash outflows are assessed.
</dd>
</dl>
<p>The main advantages of the basic technique (related to the DL):</p>
<ul>
<li>It uses semantic markup.</li>
<li>It degrades nicely (hidden elements are visible in script-disabled <acronym title="User Agent">UA</acronym>s).</li>
<li><acronym title="Definition Term">DT</acronym>s do not appear  as links without script support.</li>
<li>It does not use inline event attribute (onclick()).</li>
<li>It does not require A elements in the markup.</li>
<li>It is screen-readers &#8220;friendly&#8221;.</li>
<li>It is keyboard &#8220;friendly&#8221;.</li>
<li>It is IE Mac compatible.</li>
<li>It relies on <em>one single</em> hook.</li>
<li>It allows the author to add/move/delete DT/DD pairs easily (there is no variable in the script to edit and there are no class or ID to include nor change).</li>
<li>It is &#8220;powered&#8221; by a very light script (3Kb).</li>
</ul>
<p>About the &#8220;Show All/Hide All&#8221; &#8220;links&#8221;:</p>
<ul>
<li>they  let the user expand all answers at once, so it is possible to <em>search</em> the document.</li>
<li>they are hidden  from Javascript-challenged browsers.</li>
<li>they can  be &#8220;Named Anchors&#8221;, images or SPANs (actually they can be any inline elements or any other elements styled as inline).</li>
</ul>
<p>This is more or less a plug-and-play solution (script and stylesheets are at the <a title="Content of the script and the 2 stylesheets" href="#zStuff">bottom of this page</a>).<br />
You&#8217;ll need to:</p>
<ol>
<li>Create a <a title="Definition lists: the DL, DT, and DD elements" href="http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.3">Definition List</a> (do not use more than one <acronym title="Definition Description">DD</acronym> per <acronym title="Defintion Term">DT</acronym>.); the markup for the one above looks like this:
<div class="codewrap">
<code lang="HTML"></p>
<dl>
<dt>Question 1</dt>
<dd>The vitality of conceptual synergies...</dd>
<dt>Question 2</dt>
<dd>To focus on improvement, not cost, ...</dd>
<dt>Question 3</dt>
<dd>The vitality of conceptual synergies...</dd>
<dt>Question 4</dt>
<dd>The vitality of conceptual synergies...</dd>
</dl>
<p></code>
</div>
</li>
<li>Assign a <em>specific</em> ID to your <acronym title="Definition List">DL</acronym>:<br />
<code lang="HTML"><br />
&lt;dl id="TJK_DL" /><br />
</code>
</li>
<li>Download this <a title="This file contains the script, 2 stylesheets and 3 GIF files." href="http://www.tjkdesign.com/TJK_ToggleDL/TJK_ToggleDL.zip">ZIP File</a> (3Kb) and unzip its content in  the <em>same</em> directory as your <acronym title="Frequently Asked Questions">FAQ</acronym> page.</li>
<li>In your <acronym title="Frequently Asked Questions">FAQ</acronym> page, right above the closing headtag cut and paste the following:
<div class="codewrap">
<code>&lt;script type=&quot;text/javascript&quot; src=&quot;TJK_ToggleDL/TJK_ToggleDL.js&quot;&gt;&lt;/script&gt;</code>
</div>
</li>
<li>Call the script, for example using:
<p><code>&lt;body onload=&quot;TJK_ToggleDL()&quot;></code></p>
<p class="smallText">Note: In case you want to add multiple onload handlers to a page, make sure to read <a href="http://simon.incutio.com/archive/2004/05/26/addLoadEvent">executing JavaScript on page load</a>.</p>
</li>
<li>In order to use the &#8220;Show All&#8221; / &#8220;Hide All&#8221; feature, you will need to create 2 named anchors with  specific IDs (TJK_ToggleON and TJK_ToggleOFF). Dreamweaver users can take advantage of the &#8220;Named Anchor&#8221; icon in the toolbar to easily create the required markup. Dreamweaver will plug the  name attribute as well, but that&#8217;s OK, you can either delete it or ignore it.<br />
This is the markup I&#8217;m using in this page:</p>
<p><code>&lt;a id="TJK_ToggleON">Open All</a><&lt;a id="TJK_ToggleOFF">Close All&lt;/a></code></p>
<p class="smallText">Note:  <em>adjacent</em> anchors are  confusing in text-browsers.</p>
<p><img src="http://www.tjkdesign.com//img/important.gif" class="plainimage" alt="important note" />You can also replace these Named Anchors with other inline elements, for example SPAN or IMG (yes, <em>images</em>). Just make sure to set the proper IDs.</li>
<li>Because we want to <em>hide</em> these &#8220;links&#8221; from script-challenged <acronym title="User Agent">UA</acronym>s, you need to include the following rule somewhere inside your stylesheet:
<div class="codewrap">
<pre>#TJK_ToggleON,#TJK_ToggleOFF {display:none}</pre>
</div>
<p class="smallText">Note: You can also use a style element to include this rule in the head of your document (your <acronym title="Frequently Asked Questions">FAQ</acronym> page).</p>
</li>
</ol>
<p>You&#8217;re done!</p>
<p>Feel free to edit the  rules in the <acronym title="Cascading Styles Sheet">CSS</acronym> file to fit your needs.</p>
<p><img src="http://www.tjkdesign.com/img/important.gif" class="plainimage" alt="important note" />Note: in case your questions are more than one line long, you may want to change this: &#8220;background:0 50%&#8221; to this: &#8220;background:0 0&#8243; and add &#8220;display:block&#8221; to the #TJK_DL dt a {} rule (to avoid any &#8220;wrapping&#8221;).</p>
<h2>For the curious</h2>
<h3>TJK_ToggleDL.js</h3>
<div class="codewrap">
<code lang="Javascript"><br />
// Copyright 2006 | Thierry Koblentz - www.TJKDesign.com All Rights reserved<br />
// TJK_ToggleDL() Version 1.5.4 report bugs or errors to thierry@tjkdesign.com<br />
if (document.getElementById &amp;&amp; document.getElementsByTagName){<br />
document.write(&quot;&lt;link href=\&quot;TJK_ToggleDL/TJK_ToggleDL.css\&quot; type=\&quot;text/css\&quot; rel=\&quot;stylesheet\&quot; /&gt;&quot;)<br />
document.write(&quot;&lt;link href=\&quot;TJK_ToggleDL/TJK_ToggleDL_ie5mac.css\&quot; type=\&quot;text/css\&quot; rel=\&quot;stylesheet\&quot; /&gt;&quot;)<br />
}<br />
function TJK_doToggleDL(x){<br />
    var zDD=document.getElementById('TJK_DL').getElementsByTagName('dd');<br />
    var zDT=document.getElementById('TJK_DL').getElementsByTagName('dt');<br />
    zDD[x].className=(zDD[x].className=='hideDD')?'showDD':'hideDD';<br />
    zDT[x].className=(zDT[x].className=='DTplus')?'DTminus':'DTplus';<br />
}<br />
function TJK_ToggleDLopen(){//we open all of them<br />
    var zDD=document.getElementById('TJK_DL').getElementsByTagName('dd');<br />
    var zDT=document.getElementById('TJK_DL').getElementsByTagName('dt');<br />
    for(var i=0;i&lt;zDT.length;i++){<br />
	    zDD[i].className='showDD';<br />
	    zDT[i].className='DTminus';<br />
    }<br />
	return false;<br />
}<br />
function TJK_ToggleDLclose(){//we close all of them<br />
    var zDD=document.getElementById('TJK_DL').getElementsByTagName('dd');<br />
    var zDT=document.getElementById('TJK_DL').getElementsByTagName('dt');<br />
    for(var i=0;i&lt;zDT.length;i++){<br />
	   zDD[i].className='hideDD';<br />
 	   zDT[i].className='DTplus';<br />
    }<br />
	return false;<br />
}<br />
function TJK_ToggleDL(){<br />
    if (document.getElementById &amp;&amp; document.getElementsByTagName){<br />
	    var zDT=document.getElementById('TJK_DL').getElementsByTagName('dt;<br />
	    var zDD=document.getElementById('TJK_DL').getElementsByTagName('dd');<br />
	    var ToggleON = document.getElementById('TJK_ToggleON');<br />
	    var ToggleOFF = document.getElementById('TJK_ToggleOFF');<br />
		    if (ToggleON &amp;&amp; ToggleOFF){<br />
				ToggleON.onclick = TJK_ToggleDLopen;<br />
				ToggleON.title = &quot;Show all answers&quot;;<br />
				ToggleON.href = &quot;#&quot;;<br />
			   	ToggleOFF.onclick = TJK_ToggleDLclose;<br />
 			   	ToggleOFF.title = &quot;Hide all answers&quot;;<br />
				ToggleOFF.href = &quot;#&quot;;<br />
			}<br />
	    for(var i=0;i&lt;zDT.length;i++){<br />
    		var zContent = zDT[i].innerHTML;<br />
		    var zHref = &quot;&lt;a href='#' onclick=\&quot;TJK_doToggleDL(&quot;+i+&quot;);return false\&quot; title='Show/hide the answer'&gt;&quot;;<br />
		    zDT[i].innerHTML = zHref + zContent + &quot;&lt;/a&gt;&quot;;<br />
		    zDD[i].className='hideDD';<br />
		    zDT[i].className='DTplus';<br />
	    }<br />
    }<br />
}<br />
</code>
</div>
<h3>TJK_ToggleDL.css</h3>
<div class="codewrap">
<code lang="CSS"><br />
/*  &quot;Show All&quot; + &quot;Hide All&quot; links */<br />
#TJK_ToggleON,#TJK_ToggleOFF {border:1px solid #333;padding:0 5px;margin-right:5px}<br />
/* zeroing out padding and margin */<br />
#TJK_DL dd,#TJK_DL dt {margin:0;padding:0}<br />
/* margin for the DTs (shorthand) */<br />
#TJK_DL dt {margin:7px 0}<br />
/* image and left padding for DDs */<br />
#TJK_DL dd {background:url(answer.gif) no-repeat;padding-left:55px}<br />
/* styling all anchors in the DTs */<br />
#TJK_DL dt a {background:0 50% no-repeat;padding-left:32px;color:#000;text-decoration:none}<br />
#TJK_DL dt a:visited {color:#666}<br />
#TJK_DL dt a:visited:hover, #TJK_DL dt a:hover, #TJK_DL dt a:active, #TJK_DL dt a:focus {font-weight:bold}<br />
/* the + and - gif in the anchors */<br />
#TJK_DL .DTplus a {background-image:url(toggleDLplus.gif)}<br />
#TJK_DL .DTminus a {background-image:url(toggleDLminus.gif)}<br />
/**********************************/<br />
/**********************************/<br />
#TJK_DL .showDD {position:relative;top:0}<br />
#TJK_DL dd,.hideDD{top:-9999px;position:absolute}<br />
#TJK_ToggleON,#TJK_ToggleOFF {display:inline;cursor:pointer; <span class="highlighter">cursor:hand</span>}<br />
</code>
</div>
<p class="smallText">Note: &#8220;cursor:hand&#8221; is for IE5 Win, but this declaration will make this sheet <span class="red">fail Validation</span>. If Validation is important to you, you can either delete this declaration or move it inside a <a title="Read about MicroSoft Conditional Comments" href="http://www.last-child.com/wp-admin/conditional_comments.asp">Conditional Comment</a>.</p>
<h3>TJK_ToggleDL_ie5mac.css</h3>
<div class="codewrap">
<code lang="CSS"><br />
/**//*/<br />
#TJK_DL .showDD {display:block}<br />
#TJK_DL dd,.hideDD {top:0; position:relative; display:none}<br />
 /**/<br />
</code>
</div>
<h2>For the <acronym title="Document Object Model">DOM</acronym> police</h2>
<p>Earlier versions of this script did <em>not</em> use document.write(), I was using the <acronym title="Document Object Model">DOM</acronym> to plug the stylesheets in the HEAD element. Unfortunately, setting the rel attribute of the LINK element makes Safari &#8220;go blank&#8221; and STYLE fails in IE Win. So, I decided to go with what works!</p>
<p><img src="http://www.tjkdesign.com//img/important.gif" class="plainimage" alt="important note" />This script should work in <acronym title="HyperText Markup Language">HTML</acronym> <em>and</em> <acronym title="eXtensible HyperText Markup Language">XHTML</acronym> documents.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/the-perfect-faq-page/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
