<?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>Threepress Consulting blog &#187; css</title>
	<atom:link href="http://blog.threepress.org/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.threepress.org</link>
	<description>Threepress creates software for publishers, educators and authors.</description>
	<lastBuildDate>Fri, 03 Sep 2010 23:28:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Easier EPUB Experimenting and Updating in iBooks</title>
		<link>http://blog.threepress.org/2010/08/19/easier-epub-experimenting-in-ibooks/</link>
		<comments>http://blog.threepress.org/2010/08/19/easier-epub-experimenting-in-ibooks/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 12:00:51 +0000</pubDate>
		<dc:creator>Keith Fahlgren</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[ebooks]]></category>
		<category><![CDATA[epub]]></category>
		<category><![CDATA[ibooks]]></category>
		<category><![CDATA[ipad]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1558</guid>
		<description><![CDATA[The arrival of iBooks this year helped many people understand that ebooks were already capable of interesting experimentation, multimedia, and nuanced, thoughtful design. Many of iBooks’ strengths come directly from the fact that they wisely chose to base it on WebKit, the rendering engine core used in desktop browsers like Safari &#38; Chrome and mobile [...]]]></description>
			<content:encoded><![CDATA[<p>The arrival of iBooks this year helped many people understand that ebooks were <em>already</em> capable of <a href="http://blog.threepress.org/2010/06/24/javascript-and-interactivity-in-ibooks/">interesting</a> <a href="http://blog.threepress.org/2010/06/08/geo-aware-ebook-demo/">experimentation</a>, <a href="http://blog.threepress.org/2009/11/15/using-html5-video-in-epub/">multimedia</a>, and <a href="http://www.vqronline.org/blog/2010/06/08/vqr-ipad/">nuanced, thoughtful design</a>. Many of iBooks’ strengths come directly from the fact that they wisely chose to base it on <a href="http://webkit.org">WebKit</a>, the rendering engine core used in desktop browsers like Safari &amp; Chrome and mobile browsers for the iPhone, iPad, Android, and now Blackberry browsers. This makes it an attractive test platform for folks developing new and innovative content in EPUB, but many have <a href="http://answers.oreilly.com/topic/1918-how-ibooks-stores-user-bookmarks/">been</a> <a href="http://www.pigsgourdsandwikis.com/2010/04/updating-epub-tests-in-ibooks-on-ipad.html">frustrated</a> with the time and effort it takes to update EPUB content in iBooks on an iPad using the iTunes sync. This post outlines an easier approach for iteratively developing and testing changes to EPUB XHTML and CSS files in iBooks (1.1.2) without using iTunes.</p>
<p>Here&#8217;s a tweak to the XHTML of a chapter and the CSS used for <code>h1</code>s that I did quickly without having to make a new EPUB or use iTunes:</p>
<p><a href="http://blog.threepress.org/wp-content/uploads/2010/08/content_updates_without_itunes.png"><img src="http://blog.threepress.org/wp-content/uploads/2010/08/content_updates_without_itunes.png" alt="A screenshot from an iPad in iBooks show content modified without a sync" title="Updating iBooks without iTunes" width="799" height="541" class="alignnone size-full wp-image-1582" /></a></p>
<p>The key to this <span style="text-decoration: line-through;">hack</span> technique is the free (as in beer) <a href="http://www.macroplant.com/iphoneexplorer/">iPhone Explorer</a> application, which exposes the contents of your iPad like a USB drive (including resources for Apps). It has both a Mac and Windows version, but I’ve only tested these instructions on a Mac. Before starting, connect your iPad to your computer and iTunes. You should not be using automatic syncing (&#8220;Sync Books&#8221; is not checked).</p>
<p>To get started playing with a particular EPUB, sync the file onto your iPad, open the book once in iBooks, then close iBooks. Now you&#8217;re ready to start moving the files back and forth (iPhone Explorer is all drag and drop).</p>
<ol>
<li>Open iBooks to your Library (<strong>not</strong> a book).</li>
<li>Open iPhone Explorer (or hit Refresh if it was open, but this is occasionally flaky).</li>
<li>Expand [Your] iPad-&gt;Media-&gt;Books.</li>
<li>Find the <code>[XXXX].epub</code> you’re interested in and expand it until you find your XHTML content or CSS.</li>
<li>Drag the XHTML file or CSS you want to experiment with somewhere on your computer (perhaps your Desktop in the Finder) to edit.</li>
<li>Edit the file using something you like.</li>
<li>Drag the XHTML or CSS file back from your computer to the same location in iPhone Explorer.</li>
<li>Say &#8220;OK&#8221; to the &#8220;Overwrite?&#8221; dialog.</li>
<li>Open the book in iBooks to see the changes.</li>
</ol>
<p><a href="http://blog.threepress.org/wp-content/uploads/2010/08/how_to_update_content.png"><img class="alignnone size-full wp-image-1563" title="How content is updated without a sync into iBooks" src="http://blog.threepress.org/wp-content/uploads/2010/08/how_to_update_content.png" alt="A screenshot of updating content using iPhone Explorer" width="600" height="404" /></a></p>
<p>Now you’re ready to use steps 5–9 (closing the book in iBooks in between) to continue experimenting with the EPUB’s design or content.</p>
<p>It can occasionally be non-obvious which filename iBooks has assigned to your EPUB. Curious folks will want to play around with some of the other resources exposed in addition to the exploded EPUBs (check out <code>Books.plist</code>).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2010/08/19/easier-epub-experimenting-in-ibooks/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>JavaScript and interactivity in iBooks</title>
		<link>http://blog.threepress.org/2010/06/24/javascript-and-interactivity-in-ibooks/</link>
		<comments>http://blog.threepress.org/2010/06/24/javascript-and-interactivity-in-ibooks/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 15:36:06 +0000</pubDate>
		<dc:creator>Liza Daly</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[epub]]></category>
		<category><![CDATA[ibooks]]></category>
		<category><![CDATA[interactivity]]></category>
		<category><![CDATA[ipad]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1519</guid>
		<description><![CDATA[iBooks supports JavaScript-based interactivity in EPUB content.  
I took some content from Cooking with Booze by James Bridle (a.k.a. George Harvey Bone).  It&#8217;s released under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 license, which means that this derivative work is as well.
I took one recipe and marked it up in EPUB:

I added some slightly [...]]]></description>
			<content:encoded><![CDATA[<p>iBooks supports JavaScript-based interactivity in EPUB content.  </p>
<p>I took some content from <a href="http://cookingwithbooze.org/">Cooking with Booze</a> by James Bridle (a.k.a. George Harvey Bone).  It&#8217;s released under a <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 license</a>, which means that this derivative work is as well.</p>
<p>I took one recipe and marked it up in EPUB:</p>
<p><a href="http://3press-blog.s3.amazonaws.com/cooking-with-booze1.png"><img src="http://3press-blog.s3.amazonaws.com/sm-cooking-with-booze1.png"/></a></p>
<p>I added some slightly useless annotations and illustrative images from Flickr (also under an Attribution license).  I then added some JavaScript-based event handlers.  If you tap on the hyperlinked items in the recipe, the annotation will fade in as a popup.  Tap on the annotation to dismiss it.</p>
<p><a href="http://3press-blog.s3.amazonaws.com/cooking-with-booze2.png"><img src="http://3press-blog.s3.amazonaws.com/sm-cooking-with-booze2.png"/></a></p>
<p>There are two kinds of annotations available: image popups and textual notes. Here&#8217;s a text note:</p>
<p><a href="http://3press-blog.s3.amazonaws.com/cooking-with-booze3.png"><img src="http://3press-blog.s3.amazonaws.com/sm-cooking-with-booze3.png"/></a></p>
<p>The JavaScript here is extremely simple, though I needed to use <code>webkitTransform</code> rather than normal positioning code because iBooks does not recognize <code>position: absolute</code> and the like:</p>
<pre class="brush: jscript;">
function popup() {
  var p = document.getElementById(this.id + '-popup');
  var top_of_el = this.offsetTop;
  p.style.opacity = 1;
  var new_y = p.offsetTop - top_of_el - 30;
  p.style.webkitTransform = 'translateY(-' + new_y + 'px) translateX(' + this.offsetLeft + 'px)';
}
function dismiss() {
  this.style.opacity = 0;
  var el = this;
  setTimeout(function () {
    el.style.webkitTransform = null;
  }, 1000);
}
/* Register the events */
var terms = document.getElementsByClassName('term');
for (var i=0; i &amp;amp;lt; terms.length; i++) {
  terms[i].addEventListener('click', popup);
}
var popups = document.getElementsByClassName('popup');
for (var i=0; i &amp;amp;lt; popups.length; i++) {
  popups[i].addEventListener('click', dismiss);
}
</pre>
<p>Here&#8217;s a sample of the XHTML:</p>
<pre class="brush: xml;">
1 wild &lt;a class=&quot;term&quot; id=&quot;turkey&quot;&gt;turkey&lt;/a&gt; breast
</pre>
<p>Some other nerdy details:</p>
<ol>
<li> The fade-in effect uses CSS3. I think the iBooks implementation may not be hardware-accelerated like Mobile Safari &#8212; it&#8217;s less smooth than the transitions on <a href="http://ibisreader.com/">Ibis Reader</a>, for example. </li>
<li> Inline script blocks do not work, which is not a bad thing. </li>
<li>Scripts are disallowed from accessing remote URLs. This means that ebooks that interact with remote data, like the <a href="http://blog.threepress.org/2010/06/08/geo-aware-ebook-demo/">geo-aware ebook</a>, do not work. Interestingly, this is one of the restrictions that  Baldur Bjarnason suggested might allow for safe JavaScript use in ebooks in a <a href="http://blog.threepress.org/2010/06/22/practical-interactivity-and-shaping-the-future-of-epub/#comment-3250">recent comment</a> on our post <a href="http://blog.threepress.org/2010/06/22/practical-interactivity-and-shaping-the-future-of-epub">Practical Interactivity and Shaping the Future of EPUB</a>. </li>
<li> iBooks caching is really annoying isn&#8217;t it?</li>
<li> I haven&#8217;t tried this on iBooks for iPhone.</li>
<li>I have no idea if JavaScript is allowed in the iBookstore&#8230;</li>
<li>&#8230;not that you need Apple&#8217;s permission to sell a DRM-free enhanced EPUB that users could load into iBooks themselves.</li>
</ol>
<p><a href="https://s3.amazonaws.com/3press-blog/javascript-in-epub.epub">Download the sample EPUB book</a>.  All content in the book is licensed under a Creative Commons license of some kind; the whole bundle should be considered <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0</a>.  </p>
<p>That said, I encourage commercial publishers to explore interactivity in EPUB, and it goes without saying that <a href="http://threepress.org/">we&#8217;d love to help</a>, whether it&#8217;s to provide glosses and annotations like those shown here, or interactive quizzes, or animation, or&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2010/06/24/javascript-and-interactivity-in-ibooks/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Interactivity in EPUB using JavaScript, HTML5 and CSS3: BEA/IDPF video posted</title>
		<link>http://blog.threepress.org/2010/06/02/interactivity-in-epub-using-javascript-html5-and-css3-beaidpf-video-posted/</link>
		<comments>http://blog.threepress.org/2010/06/02/interactivity-in-epub-using-javascript-html5-and-css3-beaidpf-video-posted/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 14:29:39 +0000</pubDate>
		<dc:creator>Liza Daly</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ebooks]]></category>
		<category><![CDATA[epub]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[interactivity]]></category>
		<category><![CDATA[talks]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1467</guid>
		<description><![CDATA[I re-recorded my talk at IDPF Digital Book as a video.  Getting the audio synced properly was no fun so I apologize for a few production issues.
Interactivity in EPUB
View more videos from lizadaly.

Here&#8217;s the executive summary of the talk:

 You can add interactivity to an EPUB book using either the &#60;object&#62; or &#60;script&#62; elements.
 [...]]]></description>
			<content:encoded><![CDATA[<p>I re-recorded my talk at IDPF Digital Book as a video.  Getting the audio synced properly was no fun so I apologize for a few production issues.</p>
<div style="width:425px" id="__ss_4390733"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/lizadaly/interactivity-in-epub" title="Interactivity in EPUB">Interactivity in EPUB</a></strong><object id="__sse4390733" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/playerv.swf?doc=epub-100602085847-phpapp02-video&#038;stripped_title=interactivity-in-epub&#038;autoplay=0" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4390733" src="http://static.slidesharecdn.com/swf/playerv.swf?doc=epub-100602085847-phpapp02-video&#038;stripped_title=interactivity-in-epub&#038;autoplay=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">videos</a> from <a href="http://www.slideshare.net/lizadaly">lizadaly</a>.</div>
</div>
<p>Here&#8217;s the executive summary of the talk:</p>
<ul>
<li> You can add interactivity to an EPUB book using either the &lt;object&gt; or &lt;script&gt; elements.</li>
<li> Currently <em>object</em> has the best support, especially <a href="http://blog.threepress.org/2009/11/14/using-flash-video-in-epub/">using Flash in Adobe Digital Editions</a>.</li>
<li> The <em>script</em> element is specifically discouraged (though not disallowed) in EPUB 2.0.1, and no major reading system supports it. However, all browsers do!</li>
<li> The primary advantage of interactivity using <em>script</em> is that the content creator has the ability to manipulate every part of the ebook: all of the text, its layout, even potentially the user interface of the reading system itself. With <em>object</em> you can apply interactivity to just an arbitrary rectangle.</li>
<li> There is a great deal of interesting animation and even interactivity possible using CSS3, which <em>is</em> allowed in EPUB 2.0.1 and is supported by iBooks and <a href="http://blog.threepress.org/2010/04/02/designing-ebooks-for-epub-reading-engines/">other WebKit-based ereaders</a>.</li>
<li> Interactivity is also possible using JavaScript combined with the <a href="http://blog.threepress.org/2010/04/12/html5-for-publishers/">HTML5</a> <em>canvas</em> element, though <em>canvas</em> is not part of EPUB 2.0.1.</li>
<li> With access to JavaScript on mobile devices, ebooks can potentially gain access to information about the reading device itself, such as the location of the reader in the physical world, or the device&#8217;s orientation, or even add photos and video from the device&#8217;s camera.</li>
<li> Any ereader that allows JavaScript provides the ability for ebooks to access live data on the web.</li>
<li>The primary blocker for extremely rich interactive ebooks is ereader support, but by embedding browser-based reading systems like <a href="http://monocle.inventivelabs.com.au/">Monocle</a>, content creators can distribute such ebooks today.</li>
<li>It remains to be worked out how to handle JavaScript in larger ereading systems both safely and with proper fallbacks to non-interactive content.</li>
</ul>
<p>I&#8217;ll also be posting some of the example files used in the tutorial in a forthcoming post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2010/06/02/interactivity-in-epub-using-javascript-html5-and-css3-beaidpf-video-posted/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>HTML5 for publishers</title>
		<link>http://blog.threepress.org/2010/04/12/html5-for-publishers/</link>
		<comments>http://blog.threepress.org/2010/04/12/html5-for-publishers/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 14:58:15 +0000</pubDate>
		<dc:creator>Keith Fahlgren</dc:creator>
				<category><![CDATA[content]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ebooks]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1402</guid>
		<description><![CDATA[The launch of the iPad and iBooks and the tremendous stream of one-off demos reimagining publishing have made it extremely difficult to understand what technologies for enriched content are available to publishers today. In particular, I’ve seen a lot of confusion about what HTML5 might actually mean and what specific opportunities it might bring for [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="blog.threepress.org/2010/04/05/ibooks-and-epub/">launch of the iPad and iBooks</a> and the tremendous stream of <a href="http://www.wired.com/epicenter/2010/02/the-wired-ipad-app-a-video-demonstration/">one-off demos</a> <q><a href="toc.oreilly.com/2010/04/why-ipad-adaptation-is-an-uphill-battle-for-incumbent-publishers.html">reimagining</a></q> publishing have made it extremely difficult to understand what technologies for enriched content are available to publishers today. In particular, I’ve seen a lot of confusion about what <q>HTML5</q> might actually mean and what specific opportunities it might bring for digital reading.</p>
<p>To try to shed some light on some complicated work, I’ve pieced together a very incomplete introduction to some of the new things that HTML5 and related specifications <em>might</em> bring (remember: they aren&#8217;t finished or implemented everywhere).</p>
<p><span id="more-1402"></span></p>
<p>Seven concrete areas of opportunity:</p>
<dl>
<dt><a href="http://www.w3.org/TR/html5/semantics.html#semantics">New semantics</a></dt>
<dd>
<p>HTML5 adds <a href="http://diveintohtml5.org/semantics.html#new-elements<br />
">a bunch of new elements</a> that might help publishers represent their content more clearly.</p>
<ul>
<li class="upside"><code>section</code>, <code>article</code>, <code>header</code>, and <code>aside</code> should be very useful wrappers for real-world content.</li>
<li class="downside">Older web browsers will safely ignore unknown tags, but some ereaders that aren&#8217;t based on browsers may exhibit unexpected behavior. Also, typically, semantic tagging alone won&#8217;t drive a lot of sales.</li>
</ul>
</dd>
<dt><a href="http://www.w3.org/TR/html5/the-canvas-element.html#the-canvas-element">Drawing</a></dt>
<dd>
<p>HTML5 adds a <code>canvas</code> element, which allows for (<a href="http://www.benjoffe.com/code/games/torus/">really</a> <a href="http://n96.org/#lat=41.52&#038;lon=-100.11&#038;dist=2500">snazzy</a>) complex drawing and animation. Mark Pilgrim’s chapter in <a href="http://diveintohtml5.org/canvas.html">Dive into HTML5</a> offers not only the hairy details but also an example of how embedded HTML5 can change instructional materials (view it in Safari).</p>
<ul>
<li class="upside">This might replace some of what we think about when we say &#8216;Flash&#8217; casually. It might allow for more interactive elements to be included in content.</li>
<li class="downside">There are no easy-to-use tools that generate canvases — they must be coded by hand (Although it sounds like some basic tools <a href="http://www.9to5mac.com/Flash-html5-canvas-35409730">are close</a>).</li>
</ul>
</dd>
<dt><a href="http://www.w3.org/TR/html5/video.html#video">Video</a></dt>
<dd>
<p>HTML5 adds a <code>video</code> element, which offers the first standards-based way to embed video in a web page. Similarly, an <code>audio</code> element has been added.</p>
<ul>
<li class="upside">Seamlessly embedable video may offer new ways of assembling and delivering multimedia content.</li>
<li class="downside">Licensing for the actual encodings of the video content (the way that they&#8217;re compressed and stored) is <a href="http://www.streamingmedia.com/Articles/ReadArticle.aspx?ArticleID=65403">unbelievably messed up and getting worse</a>.</li>
</ul>
</dd>
<dt><a href="http://www.w3.org/Style/CSS/current-work#CSS3">CSS3</a></dt>
<dd>
<p>A related set of updates to the Cascading Stylesheets specifications, CSS3, is often discussed alongside HTML5.</p>
<ul>
<li class="upside">CSS3 may bring a range of delightful updates for content creators, from better support for font-faces on the web to animations and transitions that may (along with canvas) allow alternatives to Flash for <a href="http://girliemac.com/sandbox/matrix.html">flashy</a> <a href="http://devfiles.myopera.com/articles/1041/image-gallery.html">stuff</a>.</li>
<li class="downside">Licensing solutions for fonts on the web are still in-progress. Authoring tools non-existent; support not complete across browsers.</li>
</ul>
</dd>
<dt><a href="http://www.w3.org/TR/geolocation-API/">Geolocation</a></dt>
<dd>
<p>Updates to a JavaScript API alongside HTML5 allow for users to reveal their physical location.</p>
<ul>
<li class="upside">There are probably a lot of opportunities to connect reading, readers, booksellers, and where people actually are.</li>
<li class="downside"><a href="http://diveintohtml5.org/geolocation.html#w3c">Very little support</a> on desktops or more basic phones.
</li>
</ul>
</dd>
<dt><a href="http://www.w3.org/TR/offline-webapps/">Offline Applications</a></dt>
<dd>
<p>A <a href="http://www.w3.org/TR/offline-webapps/">set</a> of <a href="http://www.w3.org/TR/webdatabase/">specifications</a> related to HTML5 make it possible to create web applications that run without an active internet connection.</p>
<ul>
<li class="upside">Offline web applications can offer many of the features that standalone iPhone and Android Apps have and do not have to go through any App Store. They may also be more portable, as they don&#8217;t<br />
have to have a separate set of software for each platform. [<em>Explicitly</em>: This is the part of <q>HTML5</q> that allows <a href="http://ibisreader.com">Ibis Reader</a>  to behave just like a <q>normal</q> App on iPhones, iPads, and Android phones.]</li>
<li class="downside">Offline web applications are typically slower than standalone apps, although this will become less important as faster devices like the iPad become more common. Support on platforms is not uniform. Firefox doesn&#8217;t seem interested in supporting the current database specification.</li>
</ul>
</dd>
<dt><a href="http://www.w3.org/TR/microdata/">Microdata</a></dt>
<dd>
<p>Another related specification that provides way of adding machine-readable annotations to content.</p>
<ul>
<li class="upside">One use of microdata might be to embed content licensing and other details inside pages.</li>
<li class="downside">Yawn. Some of these features have been around in microformats for years and haven&#8217;t really taken off, although this could be very important for specialized content with regularly-structured content (cookbooks would be an easy example).</li>
</ul>
</dd>
</dl>
<p>Sadly, HTML5 support (on any of the above) in Internet Explorer (even the unreleased IE9) is woefully incomplete and IE is still the most ubiquitous browser. Look at the number of red Xs in the right-hand columns of this support chart: <a href="http://www.findmebyip.com/litmus/">http://www.findmebyip.com/litmus/</a></p>
<p>Does the above inspire you to try out some of these new opportunities now that you can pierce some of the HTML5 hype? Please <a href="http://threepress.org/contact/">let us know</a>, as we’re actively seeking publishers and authors interested in innovating and experimenting with actual content to develop short- or long-form examples that take avantage of these new possibilities for enthralling, educating, and entertaining readers.</p>
<hr />
<p>Want to explore in more detail? Both <a href="http://html5doctor.com">http://html5doctor.com</a> &#038; <a href="http://diveintohtml5.org">http://diveintohtml5.org</a> have great details on the state of the above technologies. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2010/04/12/html5-for-publishers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ePub and CSS: a reading system perspective</title>
		<link>http://blog.threepress.org/2010/03/22/epub-and-css-a-reading-system-perspective/</link>
		<comments>http://blog.threepress.org/2010/03/22/epub-and-css-a-reading-system-perspective/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 13:56:54 +0000</pubDate>
		<dc:creator>Keith Fahlgren</dc:creator>
				<category><![CDATA[book design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ebooks]]></category>
		<category><![CDATA[epub]]></category>
		<category><![CDATA[ibisreader]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1336</guid>
		<description><![CDATA[ePubs are being created with increasingly sophisticated designs and ebook devices are becoming increasingly powerful. This creates a real tension: ePub creators want to be able to develop nuanced ebook designs using CSS, the makers of ePub reading systems face an expanding range of screen sizes (from postage stamp to poster size), and some readers [...]]]></description>
			<content:encoded><![CDATA[<p>ePubs are being created with increasingly sophisticated designs and ebook devices are becoming increasingly powerful. This creates a real tension: ePub creators want to be able to develop <a href="http://epubzengarden.com/">nuanced ebook designs</a> using CSS, the makers of ePub reading systems face an expanding range of screen sizes (from postage stamp to poster size), and some readers have become accustomed to being <a href="http://www.lexcycle.com/faq#3n104">able to control every aspect of the setup of their reading environment</a>. One of the great aspects of the design of the ePub specification is that it <a href="http://www.alistapart.com/articles/ebookstandards/">uses many of the same standards as the web</a>. This means that publishers can turn to a web designer for CSS help rather than having to find someone more specialized and rare.</p>
<p>As folks who need to listen to <a href="http://getsatisfaction.com/threepress/products/threepress_ibis_reader">the desires of ebook readers</a>, <a href="http://threepress.org/#recent">help publishers understand how to get the best from ePub</a>,  and <a href="http://blog.threepress.org/2009/02/09/introducing-epubjs/">implement</a> <a href="http://bookworm.oreilly.com/">increasingly</a> <a href="http://epubzengarden.com/">sophisticated</a> <a href="http://ibisreader.com/">ePub readers</a>, we&#8217;ve gotten used to riding a fine line between enabling thoughtful design and ensuring a pleasant reading experience on a wide range of devices. Here are some pragmatic perspectives from our experience building reading systems that can help those coming from a web CSS background understand some of the tradeoffs in the ebook design world.</p>
<p>I&#8217;ll start with a simple example of the impact of CSS <code>margin</code> and <code>width</code> on an iPhone-sized screen:</p>
<p><a href="http://blog.threepress.org/wp-content/uploads/2010/03/iphone_css_margins-1.png"><img src="http://blog.threepress.org/wp-content/uploads/2010/03/iphone_css_margins-1.png" alt="A display of the impact of CSS margins on an iPhone-sized screen" title="CSS Margins on an iPhone" width="717" height="630" class="alignnone size-full wp-image-1337" /></a></p>
<p>This may look like a minor change, but the line lengths were reduced from 34 characters down to 27. Either one of those line lengths is already less than the typical &#8220;sweet-spot&#8221; from printed book design, so losing nearly 20% is actually quite significant. The real surprise from the margin example above is that it comes from <a href="http://feedbooks.com">Feedbook</a>&#8217;s tremendously reasonable CSS. </p>
<p>The problem (from the perspective of a reading system) is this: readers need top-level margins to make the text digestible, but we can never unambiguously tell if the ebook designer has already included top-level margins in the design. Basic, top-level margins should be established by <em>every</em> reading system based on the device being used and designers should include margins in their CSS only when they are focused on a specific type of content like a blockquote or poem. Unfortunately, some early ePub reading systems failed to establish even basic margins for readability, so many ePubs are designed to compensate for that flaw. [If you'd like a future post explaining the history of how we got to this position, please let us know in the comments.] </p>
<p>Now we&#8217;re in a chicken-and-egg fight: if ebook designers would include more complex design elements (and eliminate unnecessary margins), the makers of ebook reading system would be more motivated to fix their margin bugs and add more CSS support. Today, the maker&#8217;s of ebook reading systems might honestly believe that these features aren&#8217;t requested because the designers are being understandably pragmatic about current capabilities in the wild. We&#8217;d like to encourage more deliberate ebook design, but also inform designers about some of the basic design elements that might be dropped on the floor by the reading system.</p>
<p>What do we do in <a href="http://ibisreader.com">Ibis Reader</a>? Because of limitations in screen size, Ibis Reader tries to override the following CSS properties when used on an iPhone, iPod Touch, Droid, or Nexus One (as an installed app) at the chapter level:</p>
<dl>
<dt>Left and right <code>padding</code> and <code>margin</code></dt>
<dd>We need to be able to limit the length of lines.</dd>
<dt><code>width</code></dt>
<dd>We need to be able to ensure that the user interface isn&#8217;t ever wider than the screen, so that scrolling isn&#8217;t required (except for code or other verbatim blocks).</dd>
<dt><code>font-size</code></dt>
<dd>Readers have a wide range of ability and sightedness, so we give them control of the base font size (but relative sizing still works as expected).</dd>
<dt><code>font-family</code></dt>
<dd>This one is a bummer. The current set of mobile devices don&#8217;t all support some of the newest techniques for including other fonts, so we&#8217;re limited to a <a href="http://daringfireball.net/2007/07/iphone_fonts">tiny number of font families</a> at this time.</dd>
</dl>
<p>Happily, the web version of Ibis Reader does not have these restrictions, especially when used on a big screen, so the design from the ePub is usually more faithfully preserved. However, we do still discourage ebook designers from using the following CSS properties:</p>
<ul>
<li>Left/right <code>padding</code> and <code>margin</code>s (only when applied too broadly)</li>
<li><code>width</code>, <code>mid-width</code>, and <code>max-width</code> (percentage-based more permissible)</li>
<li><code>background-image</code> (and friends), which happen to be excluded from the <a href="http://www.openebook.org/2007/ops/OPS_2.0_final_spec.html#Section3.3">OPS CSS subset</a></li>
<li>Inline with the OPS spec, the use <q><a href="http://www.openebook.org/2007/ops/OPS_2.0_final_spec.html#Section1.3.5">of the CSS position property values to achieve absolute positioning (i.e. absolute and fixed) is strongly discouraged.</a></q></li>
</ul>
<p>That said, none of the above are hard and fast rules, and there may be occasions where any one of the above is entirely justified by the confident.</p>
<p>PS: A secret for ebook designers: While there are a lot of techniques the creator of a reading system can use to alter the CSS from an ePub, the most standards-compliant way you can make your voice heard is to use the <a href="http://www.w3.org/TR/CSS2/cascade.html#important-rules"><code>!important</code> declaration</a>. Like any tool with great power, <code>!important</code> should be used sparingly and only in situations where you are confident that the clarity of the text will be compromised if a property is not honored.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2010/03/22/epub-and-css-a-reading-system-perspective/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>CSS columns for ebook text</title>
		<link>http://blog.threepress.org/2010/03/08/css-columns-for-ebook-text/</link>
		<comments>http://blog.threepress.org/2010/03/08/css-columns-for-ebook-text/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 14:00:36 +0000</pubDate>
		<dc:creator>Liza Daly</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1239</guid>
		<description><![CDATA[Of all the problems I needed to solve to develop the mobile version of Ibis Reader, I didn&#8217;t think I&#8217;d need to solve pagination. &#8220;WebKit supports CSS3 columns, I don&#8217;t have to worry about it.&#8221;
My idea was that I&#8217;d make the viewport as wide as a single column but force at least 2 columns, and [...]]]></description>
			<content:encoded><![CDATA[<p>Of all the problems I needed to solve to develop the mobile version of <a href="http://ibisreader.com/">Ibis Reader</a>, I didn&#8217;t think I&#8217;d need to solve pagination. &#8220;WebKit supports <a href="http://www.w3.org/TR/css3-multicol/">CSS3 columns</a>, I don&#8217;t have to worry about it.&#8221;</p>
<p>My idea was that I&#8217;d make the viewport as wide as a single column but force at least 2 columns, and let the user swipe or tap to slide the viewport right and left across all the pages.  When I implemented it, it appeared to work great.  There was just one problem.</p>
<p>WebKit CSS3 columns are actually broken.</p>
<p>The problem is that elements that are flowed into columns don&#8217;t report their position properly.  They report their position as if they weren&#8217;t in the column at all, but instead had just flowed normally. </p>
<p>This is pretty much a deal-breaker if you want to be able to know what text is on the current &#8220;page&#8221;, for example, to sync your position across devices.</p>
<p>Here&#8217;s a test case that exhibits the problem. I&#8217;m requesting the horizontal position of an element that falls in the second column.  It should report a value that&#8217;s greater than the width of the first column.  Instead it reports a tiny value, as if that text were actually positioned up against the left margin.</p>
<p><b>Chrome, Safari, Mobile Safari, Android</b></p>
<p><a href="http://blog.threepress.org/wp-content/uploads/2010/03/Screen-shot-2010-03-07-at-9.09.17-PM.png"><img src="http://blog.threepress.org/wp-content/uploads/2010/03/Screen-shot-2010-03-07-at-9.09.17-PM.png" alt="" title="Screen shot 2010-03-07 at 9.09.17 PM"  class="aligncenter size-medium wp-image-1241" style="border:1px solid gray"/></a></p>
<p>Ironically, Firefox, which lags behind WebKit in its HTML5 support, does the correct thing:</p>
<p><a href="http://blog.threepress.org/wp-content/uploads/2010/03/Screen-shot-2010-03-07-at-9.09.25-PM.png"><img src="http://blog.threepress.org/wp-content/uploads/2010/03/Screen-shot-2010-03-07-at-9.09.25-PM.png" alt="" title="Screen shot 2010-03-07 at 9.09.25 PM" class="aligncenter size-medium wp-image-1240" style="border:1px solid gray"/></a></p>
<p>You can download the test case <a href="http://blog.threepress.org/css-columns-position.html">here</a> and run it in any browser.</p>
<p>Unfortunately for us, this meant we had to implement pagination entirely in JavaScript.  I&#8217;ve done this a few times before (such as in the <a href="http://epubzengarden.com/">ePub Zen Garden</a>), but that wasn&#8217;t with arbitrary HTML.  We worked really, really hard to get JS-based pagination to be as accurate and efficient as possible, but it&#8217;s still one of the most resource-intensive parts of the app, and a primary reason why it&#8217;s not as fast as a native app.</p>
<p>I&#8217;ve been told that this bug is fixed in the WebKit source, but since we&#8217;re at the mercy of the deployed versions on mobile devices we never further investigated. The moment this fix lands in a consumer browser we&#8217;ll switch to supporting it, which should be a huge performance boost.</p>
<p><em>Update March 8, 2010:</em> <a href="http://blog.threepress.org/2010/03/08/css-columns-for-ebook-text/comment-page-1/#comment-2301">Confirmed fixed in WebKit nightly</a>, so eventually this fix should filter down to the mobile browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2010/03/08/css-columns-for-ebook-text/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
