Showing posts with label kindle. Show all posts
Showing posts with label kindle. Show all posts

June 22, 2012

Our New eBook Startup - BB eBooks


We have officially launched our eBook design startup based in Bangkok, Thailand—BB eBooks. Our company’s business model is simple: “providing quality services at a low cost.” At BB eBooks we would like to assist independent authors and small presses turn their manuscripts into professional eBooks, so that they can make great sales at all the major online retailers (e.g. Amazon's Kindle Store, Barnes & Noble's Nook, iBookstore, Smashwords, etc.) The eBook conversion process can be frustrating for independent authors and small presses due to the changing requirements and new technologies. We want to help the writing community and our services are only a one-time fee—BB eBooks takes no royalties and does not charge hidden fees. Your manuscript can become an eBook for as low as $50, so please visit our website to learn how we can help you. We can also do Print-on-Demand. All of the quotes for our services we provide are no-obligation. Also, please sign up for the mailing list for promotions, design & marketing tips, plus eBook industry news.

BB eBooks also has an online eBook reader, and we have a small library of some of the classics in the public domain. This service is absolutely free for you to enjoy a casual read. The BB eBooks reader works on any device—PCs, tablets, and mobile—right in your favorite web browser. For those writers, editors, and publishers looking to go the DIY route for eBook production (you probably are if you visited this page), we offer free online tutorials and apps to help you professionally design your eBook. Please visit our Developers page and let’s work together to improve the overall standards of eBooks.

Thank you very much for your time, and we look forward to hearing from you.

Sincerely,


Bee and Paul




FOR IMMEDIATE RELEASE
===========
BB eBooks Provides Affordable Services for Self-Publishing Authors and Small Presses

Bangkok, Thailand – June 20, 2012 – BB eBooks recognizes the rapid growth of the eBook market and understands the writer's needs to have full control over their crafted work. With its technical knowledge, customer-oriented approach, and understanding of the eBook market, BB eBooks seeks to provide self-publishers and small presses with professional design services for all eBook formats. BB eBooks utilizes the latest technology – HTML, CSS, and XML – to make sure that all eBooks look excellent across a wide range of electronic devices.

One of the main advantages of eBooks is portability, replacing the burden of carrying around the tremendous weight of textbooks, hardcovers, and other large print formats. Typically, an eBook reader can store up to 1,000+ books and it facilitates sharing amongst readers instantaneously. Another benefit of eBooks is the low-cost due to lack of warehousing and distribution requirements.

Unfortunately, many eBooks sold by the major distributors (i.e. Amazon, Apple, and Barnes & Noble) are poorly designed and frequently criticized by readers. When asked how BB eBooks would improve standards in eBook design, Paul Salvette (Managing Director) replied, "We focus on using the latest technology standards and our own knowledge of HTML/CSS to handcraft each eBook, rather than just trying to use bloated software to convert a print book to an eBook."

Many authors and small presses face technical challenges in trying to achieve a professional-quality eBook. Panich Choonhanirunrit (Director of Marketing and Sales), who is also a writer, said, "We really want to alleviate the burden in the publishing process by providing the outstanding eBook design at an affordable price. That way, writers can spend their valuable time focusing on what's important—writing."

The company aims to turn information into professional eBooks as a service to the content-creating community. This will allow writers and small presses with limited budgets to sell their eBooks world-wide.
Share/Bookmark

June 11, 2012

Embedding Fonts in Kindle eBooks


Thank you for visiting this eBook design tutorial. We now have an eBook design startup—BB eBooks—dedicated to helping independent authors and small presses get their eBooks formatted, converted, and ready for sale at all the major online retailers (e.g. Amazon's Kindle Store, Barnes & Noble's Nook, iBookstore, Smashwords, etc.) Please contact us for a no-obligation quote. For those writers, editors, and publishers looking to go the DIY route for eBook production (you probably are if you visited this page), we offer free online tutorials and apps to help you professionally design your eBook. Please visit our Developers page and let’s work together to improve the overall standards of eBooks. Also, please sign up for the mailing list for promotions, design & marketing tips, plus eBook industry news.



Looking for a complete guide on eBook design and development? Please consider The eBook Design and Development Guide, which contains everything you need to know about HTML, CSS, EPUB, and MOBI/KF8 to make an eBook like a pro. Pick it up at Amazon for $6.99 today.

Publishers who have extensive experience in the print industry know that the fonts which are chosen when a book goes to print is an extremely important decision. However, this thought process must be radically changed when it comes to eBooks. Readers like to have complete control over the reading experience. One of the great things about eBooks is that readers can change the font to whatever is suitable for them. Perhaps they like Times New Roman (a serif font that was designed for newspapers). Perhaps they enjoy reading with an Arial font (a common sans-serif font). Perhaps they prefer to use some unique font that they found somewhere else (this can be done if by “jailbreaking” the Kindle). Everyone is different. For this reason, this guide discourages defining fonts on eBooks for content text. There is also the matter of contentious and confusing legalities regarding embedding fonts in eBooks. However, if you are determined to define a font for your content, it is possible to do so with the Kindle Fire.

The Core Kindle Fonts

The older e-ink Kindles and Kindle for iOS support two types of fonts: Palantino and Courier New (a mono-spaced font). Font embedding is not allowed; therefore, there is not much selection.
The two fonts of the e-ink Kindle/Kindle for iOS
Luckily, the newer Kindle Fire offers a bit more variety. Kindle Fire users have the option to select the following core fonts on their device:
  • Georgia (the default)
  • Caecilia
  • Trebuchet
  • Verdana
  • Arial
  • Times New Roman
  • Courier
  • Lucida
Fonts Supported Natively by Kindle Fire

To change fonts using CSS, here is the basic syntax for the property/value combination:
font-family: "Font Name", "Fallback Font", "Another Fallback Font";
Note that the quotes are required on the font name if it has a space within its name, (e.g. "Times New Roman"). Also, ensure that you correctly capitalize the font name per the list above. It is standard practice to include "fallback fonts" in font-family declarations. The eReading device will attempt to load the fonts from left to right; so, if the first font is not recognized by the device for whatever reason, it will try to load the second one. It is also standard practice to have the last fallback font as one of the generic families (i.e. "serif", "sans-serif", or "monospace").
As an example, suppose we wanted a paragraph to have the Courier typeface with some Verdana inside. Some example CSS would be as follows:
p.courier
{
font-family: "Courier", monospace;
}

span.verdana
{
font-family: "Verdana", sans-serif;
}
Different Font Examples on the Kindle Fire

Please try to experiment with different fonts, but remember to be careful about how you type in the font name in your CSS, or else it will not properly render.

Important Note: Due to anomalies in the Kindle Fire Previewer device, some typical fonts such as "Comic Sans" and "Helvetica" may appear to be working properly on the Previewer, but they will not work on an actual Kindle Fire. The only fonts that work "natively" on the Kindle Fire are the eight listed above. It may be wise to embed your fonts (as discussed below) if you cannot test your eBook on an actual Kindle Fire device.

Embedding Fonts

For those eBook designers who want to take things to the next level, you may wish to embed a font that is not supported natively in the Kindle Fire. Beware. You have to make sure you have the proper license and rights or you (or your client) can get your pants sued off by a bunch of low-life copyright trolls. One way to be sure that your desired font is okay to use commercially is to visit the Font Squirrel website. They have an outstanding selection of fonts to choose from, and you simply download the font file (in ttf and otf format) from different foundries. Make sure to read the license agreement from each specific foundry to verify that it is okay to embed in an eBook.

Say you want to change the headings of your eBook to a font from an excellent open-source foundry, such as The League of Moveable Type. Let's try the Orbitron font to make our chapter headings more fancy. You need to declare the new font with an @font-face declaration at the beginning of your CSS. This defines a name for your font and points to the file. The file name is relative to the location of the CSS.

For this example, the Orbitron otf font has a filename of orbitron-medium.otf and is located in the same directory as the CSS file. To be able to use this font, the CSS is as follows:
@font-face
{
font-family: "My Awesome Font";
src: url("orbitron-medium.otf");
}
You now can access the font "My Awesome Font" anywhere in your CSS the same way you would declare a core font. Declaring this font for all h2 headings would simply look as follows:
h2
{
font-family: "My Awesome Font", "Helvetica", sans-serif;
font-size: 1.5em;
text-align: center;
}
Embedded Font in Kindle Fire

Important Note: You also have to include the font file in the eBook package. This will be discussed later in the guide.
Share/Bookmark

April 18, 2012

Indents, Margins, and Alignment for the Kindle Fire


Thank you for visiting this eBook design tutorial. We now have an eBook design startup—BB eBooks—dedicated to helping independent authors and small presses get their eBooks formatted, converted, and ready for sale at all the major online retailers (e.g. Amazon's Kindle Store, Barnes & Noble's Nook, iBookstore, Smashwords, etc.) Please contact us for a no-obligation quote. For those writers, editors, and publishers looking to go the DIY route for eBook production (you probably are if you visited this page), we offer free online tutorials and apps to help you professionally design your eBook. Please visit our Developers page and let’s work together to improve the overall standards of eBooks. Also, please sign up for the mailing list for promotions, design & marketing tips, plus eBook industry news.



Looking for a complete guide on eBook design and development? Please consider The eBook Design and Development Guide, which contains everything you need to know about HTML, CSS, EPUB, and MOBI/KF8 to make an eBook like a pro. Pick it up at Amazon for $6.99 today.

Previous Post: CSS Box Model

The default rendering of HTML content in eBook reading devices is not exactly a pretty sight. Typically, there will be no indents, justified text, and the same spacing in-between each paragraph. This dullness and uniformity create a poor experience for the reader. People who upload .doc files directly into the Kindle Direct Publishing program get results like this, and their lack of knowledge of HTML directly correlates with poor sales. By using some simple CSS styling, you can make your eBook stand out from the rest of the crowd.

Block vs. First-Line Indenting


There are two commonly accepted styles for paragraphs: block and first-line indent. Block paragraphs are typical for non-fiction. It involves no indents in the opening sentence, but leaves a blank line in-between every single paragraph. First-line indent paragraphs have a small indent on the first sentence of the paragraph, but no space in-between paragraphs. Both paragraph styles allow the reader to easily determine when a paragraph starts and when a paragraph ends. This typography convention is not new, but it gets screwed up by poor eBook design.

Below is an example of the different paragraph styles:
Block vs. First-Line Indenting Example in Chrome

Joel Friedlander has an excellent post on the subject of paragraph styles, and he strongly advises to choose one or the other, but never both.

It may be tempting for you hipsters who still use typewriters to consider inserting a <br /> tag in-between every paragraph for the block style, or blank spaces for each first-line indent. This is extremely sloppy eBook design, and it is much easier (and professional) to utilize CSS to get the job done. A CSS property is used here called text-indent, which adds an indent to the first line of every paragraph.

For block paragraphs, you can use the following CSS:
p {
text-indent: 0;
margin: 1em 0 0 0;
padding: 0;
}
For first-line indent paragraphs, you can use the following CSS:
p {
text-indent: 1.25em;
margin: 0;
padding: 0;
}
Notice how the selector p was used, so that every single <p> element will have this styling throughout the eBook. This makes life easier, because you do not have to insert a class name into every paragraph element that you want to have styled. It is considered a good practice to have between a 1em and 2em indent for fiction, and this guide recommends 1.25em. However, you should feel free to adjust it to get the look you desire. Also, don't forget the "trouble" mnemonic for remembering the four values following the margin property (top-right-bottom-left).

Aligning Text


All of the content in your eBook is not going to be paragraph elements. You probably want to add some chapter headings, section breaks, and other bit of content that will not have the same styling characteristics as your standard paragraphs. There is a handy CSS property called text-align that allows you to align the text with the self-explanatory values of left, center, right, or justify.

By default, the Kindle typically sets text-align to justify; however, other eBook reading devices (like iBooks and Adobe Digital Editions) sets text-align to left. The jury is still deciding on whether left-aligned text or fully-justified text is better for eBooks, so you should trust your instinct and go with the whichever one you feel is best for your readers.

Here is an example of different CSS styles being applied alter content alignment:
h2 {text-align: center;}
p {text-align: justify;}
p.leftaligned {text-align: left;}
p.rightaligned {text-align: right;}
And the HTML:
<h2>Some Chapter Heading in the Middle</h2>
<p>This a normal paragraph. Some people prefer left-aligned paragraphs, but others prefer justified. Which one is better? You have to make that decision as the designer.</p>
<p class="leftaligned">This paragraph is aligned to the left without an indent. Some people think this is more appropriate, particularly for works of fiction. However, it leaves a nasty ragged-right edge. If you like it better, set the alignment CSS for all paragraph elements to the left.</p>
<p class="rightaligned">This paragraph is aligned to the right. This might only be suitable if you are ending something with a signature. Use with discretion.</p>


Alignment Examples in the Kindle Fire

Important Note: The text-align property is actually aligning the text within the content area of the box, but it is not aligning the box. Even though the text appears to be centered in the above example, the h2 box is actually fanned out across the width of the viewport, since the margins are 0 by default. You need to adjust the margin property to actually align the box within the viewport. If you are confused by this, please consult Liz Castro's discussion of the subject.

Using Margins to Your Advantage


Now that you are a whiz at the CSS Box Model, you can actually adjust the margins of your eBook to utilize some neat typographical tricks. For instance, suppose you have a quote or citation that you want to offset from the regular content. Typically, block quotes have spacing on both the left and right so that their width is shorter than the standard content paragraphs. You can adjust the margins on the left and right to achieve this effect. Changing the margins should not be confused with altering the indent; because, the indent only affects the first-line while the margin affects the entire box (i.e. all lines of text within the paragraph).

Here is some example CSS for a block quote:
p {
text-indent: 1.25em;
margin: 0;
padding: 0;
text-align: justify;
}
p.blockquote {
text-indent: 0;
margin: 0 2.5em 0 2.5em;
padding: 0;
font-style: italic;
}
And here is the corresponding HTML:
<p>This is the paragraph of normal content. In this case, it has a first-line indent so it would probably be a work of fiction.</p>
<p class="blockquote">Notice the margins here on this notable quotable. It's shorter on both the left and right.</p>

Working with Margins


Tip: When creating your stylesheet, be careful when you use selectors that grab all elements (in the above examplep). If we had not made the declaration for the blockquote class o text-indent: 0;, then the indent for the quote would have been 1.25em creating an ugly offset.

As mentioned in the previous section, the older e-ink Kindles render margins differently than the Kindle Fire. When overlapping regions of adjacent boxes have margins not equal to zero, the e-ink Kindles will add them up, while the Kindle Fire renders the largest margin value. To avoid frustration, a good practice is to only declare the top margin with a non-zero value and always have the bottom margin be zero.

Depending on the design you are trying to achieve, you may want to make the first paragraph in a chapter have a larger top margin than subsequent paragraph elements, so that there is ample space between that first paragraph and the heading.

Some example CSS would be as follows:
h2 {margin: 0; padding: 0; text-align: center;}
p {margin: 1em 0 0 0; padding: 0; text-align: justify; text-indent: 0;}
p.firstpara {margin: 2em 0 0 0;}
And the HTML:
<h2>Chapter Heading</h2>
<p class="firstpara">This is the first paragraph of a chapter that occurs after a heading. Notice how there is a 2em margin between the h2 box and this paragraph box.</p>
<p>This is just a regular old &lt;p&gt; tag. It keeps a margin of 1em from the paragraph above it, so that the reader thinks that it is a blank line.</p>
Tricking Out Kindle's Margins

Putting Everything Together


This is a lot of information to take in, and you really need to experiment on your own to get your eBook design the exact way you want it. Let's try putting together a story with all the styling characteristics you've learned so far. The content is a chapter of some Top Gun fan fiction, which may not be Shakespeare, but we can at least make the design look nice. Hypothetically, we want to have the following types of content in this chapter of our eBook:
  • a centered chapter heading
  • the first paragraph of the chapter must be spaced from the chapter heading by 2em
  • first-line indent paragraph style with a fully-justified alignment
  • a quote that has a block paragraph style with left-justified alignment
Some suitable CSS to accomplish this:

h2 {
margin: 0;
padding: 0;
text-align: center;
font-size: 1.5em;
font-weight: bold;
}

p {
text-indent: 1.25em;
margin: 0;
padding: 0;
text-align: justify;
font-size: 1.0em;
}

p.firstpara {
margin: 2em 0 0 0;
}

p.blockquote {
text-indent: 0em;
margin: 1em 2.5em 0 2.5em;
font-style: italic;
}

p.firstpara_after_blockquote {
margin: 1em 0 0 0;
}

span.i {font-style: italic;}
And the HTML containing this wretched story:
<h2>Top Gun Romance</h2>
<p class="firstpara">Navy officers playing volleyball in the sun. Dogtags dangling from their muscular chests. It cannot be disputed that this scene was the most awesomest scene in the history of cinema.</p>
<p>What's this? Goose has a wife? Impossible! It must be cover. Did you see how he reacted when Tom Cruise made this phenomenal, witty quip.</p>
<p class="blockquote">Eh, lieutenant, what were you doing there?</p>
<p class="blockquote">Communicating. Keeping up foreign relations. You know… giving him the bird.</p>
<p class="firstpara_after_blockquote">When I was in the Navy, we had a lot of discussion about how this movie really paved the way for Don't Ask Don't Tell to be repealed.</p>
<p>The movie, <span class="i">Top Gun</span>, and it's excellent soundtrack were so ahead of its time.</p>
Sample eBook Content with Various CSS Applied in Kindle Fire

There are a lot of CSS declarations in the preceding example, but this is typical of what a stylesheet for a real eBook looks like. Pay particular attention to how the top margins work. We had to declare special classes for paragraphs that come after the chapter heading and the block quote. This is because we wanted to have that extra amount of spacing not inherent in the normal first-line indent paragraph style. Bottom margins are kept at zero throughout all paragraphs to ensure the spacing is not different between e-ink Kindles and the Kindle Fire. Also note that we had to declare text-indent: 0; for the blockquote class, because we had already set text-indent: 1.25em; for all paragraphs. Recall the CSS specificity hierarchy ensures that anything with a class will override the declarations made for general elements.

As you become more proficient and advanced with CSS, be sure to keep a big-picture view in mind of how one simple declaration can affect the styling of your entire eBook.

Next Post: Page Breaks and Hyphenation
Share/Bookmark

April 6, 2012

Using CSS to Style Text for eBooks


Thank you for visiting this eBook design tutorial. We now have an eBook design startup—BB eBooks—dedicated to helping independent authors and small presses get their eBooks formatted, converted, and ready for sale at all the major online retailers (e.g. Amazon's Kindle Store, Barnes & Noble's Nook, iBookstore, Smashwords, etc.) Please contact us for a no-obligation quote. For those writers, editors, and publishers looking to go the DIY route for eBook production (you probably are if you visited this page), we offer free online tutorials and apps to help you professionally design your eBook. Please visit our Developers page and let’s work together to improve the overall standards of eBooks. Also, please sign up for the mailing list for promotions, design & marketing tips, plus eBook industry news.



Looking for a complete guide on eBook design and development? Please consider The eBook Design and Development Guide, which contains everything you need to know about HTML, CSS, EPUB, and MOBI/KF8 to make an eBook like a pro. Pick it up at Amazon for $6.99 today.

Previous Post: CSS Selectors

Now that you have knowledge of how to use CSS selectors to apply presentation to specific HTML markup and content, you can make some basic typographical adjustments to your eBook to make it visually pleasing for your readers. Typography dates back to the Classical period when specialists would use punches and chisels to make distinctive inscriptions. Luckily, the digital age offers the ability to utilize typography without a lot of training and hard work.

Altering Text into Bold, Italics, Underlined, Strikethrough, and Small Caps


Utilizing bold, italics, underlined, and occasionally strikethrough and small caps text can convey meaning and emphasis for certain words. Certain content, like the titles of movies, is also recommended to be italicized per the Chicago Manual of Style. Don't come off as uneducated to your readers due to a misunderstanding of CSS, because you will get slammed in your reviews. The properties and values in CSS for this type of text are simply as follows:
  • Bold: font-weight: bold;
  • Italics: font-style: italic;
  • Underline: text-decoration: underline;
  • Strikethrough: text-decoration: line-through;
  • Small caps: font-variant: small-caps;
All that is required is applying these declarations using CSS selectors. Some example HTML of a passage in our book could be as follows:
<h2 class="mysmcaps">Chapter X</h2>
<p>This paragraph needs some <span class="i">emphasis</span>, as well as some <span class="b">strong emphasis</span>. Being modest is <span class="strk">best</span> the worst, because I can't <span class="u">underline</span> things.</p>
The corresponding CSS to select the HTML would be as follows
h2.mysmcaps {font-variant: small-caps;}
span.b {font-weight: bold;}
span.i {font-style: italic;}
span.u {text-decoration: underline;}
span.strk {text-decoration: line-through;}
Styling Some In-Line Text

This type of CSS presentation you typically want to apply to only a word or two within a paragraph. Therefore, it is usually most appropriate to use an in-line span element within your HTML markup to hook the CSS with a class attribute. However, you could easily style entire paragraphs or even the entire <body> element as bold, italics, underline, or strikethrough.

Tip: The class names in the CSS are completely arbitrary, but you should name them something that is logical and easy to remember so you can repeat throughout the HTML of your eBook.

Leading


Leading is a typography term that originates from when typesetters would jam strips of lead in between rows of type. It defines the spacing in between lines. For the Kindle, you probably do not need to adjust this value, since the default leading on the devices is designed for a good reading experience. However, this is good typographical knowledge to have in case of future changes to the platform.

Paragraphs with short leading have the lines of text very close together, and it is a lousy reading experience, especially for fiction. Therefore, be careful when adjusting the leading. The CSS declaration to modify the leading is simply line-height: value;, where the value is a relative percentage (100% being the value for "single-spaced" paragraphs). 120% leading tends to look nice for both fiction and non-fiction, but you should feel free to experiment. The Kindle Fire and e-ink Kindles have a default of 120% leading. You may be familiar with the term "double-spaced" text, which is a leading value of 200%. It is not recommended that you ever double-space text in an eBook, because it looks incredibly childish and silly.

Some sample HTML and CSS where leading of varying amounts is applied is as follows:
<p class="shortleading">This is a paragraph that has too little leading. It is terrible on the eyes and not recommended unless you hate your readers.</p>
<p class="goodleading">This is a paragraph that has a nice amount of leading. Notice how it is easy to read.</p>
<p class="bigleading">This paragraph has too much leading. Double-spaced paragraphs might be okay for manuscripts and book reports for your 7th-grade English teacher, but it looks extremely unprofessional.</p>
The CSS:
p.shortleading {line-height: 70%;}
p.goodleading {line-height: 120%;}
p.bigleading {line-height: 200%;}
Examples of Paragraphs with Various Leading in Chrome

Leading adjustment with the line-height property does not affect e-ink Kindles or Kindle for iOS apps. On the Kindle Fire, you cannot have leading less than 120%. If you do specify a leading of 70%, as an example, the presentation would simply remain at the default of 120%.

Introducing em


Em is another typographical term that defines the height of the letter "M" block when the printing press was the hottest new invention since the Magna Carta. Why should you care? Frequently, web developers and eBook developers use measurements (e.g. pixels or "px") to define font sizes, indents, and the spacing of margins. In the digital age, the "em" unit has evolved into what is called a relative measurement, which means that the font-size, margin, indent, and other presentation properties will scale based on the reader's pre-defined font settings rather than a specific value assigned by the designer. That's great news for readers, because it allows them to read an eBook with their own preferences. Don't ever mess with a reader's experience.

The Kindle and Kindle Fire default font size is 16px. Therefore, using a font-size of 2em is equivalent to 32px (or 200%) as an example. Instead of trying to remember this when you use your stylesheet to adjust the sizes of fonts, you can simply use a value of 1.0em. When a reader changes their font setting to bigger or smaller on the Kindle, it will render the text appropriately regardless of whether the text is specified in an absolute and relative measurement. However, many web browsers and eBook reading devices render the font-size to the absolute measurement regardless of the user's preference. You should endeavor to use relative measurements as a best practice, so that your eBook will be reader-friendly across all devices.

Adjusting Font-Size

Now that you understand the importance of using the relative measurement "em", you can begin altering the size of your text. You probably want headings to be greater than 1em, content text to be 1em, and footnotes and endnotes to be a bit smaller font size than everything else. As an eBook designer, this task may seem trite and not particularly challenging. However, neglecting small details can create an unpleasant reading experience for your reader. One of the most common errors in eBooks is poorly sized text (such as the chapter heading being smaller than the content in the chapter).

To change the size of the text, you simply use the CSS property font-size: value;, where value is in a unit of ems. An example of the HTML would be as follows:
<h2 class="chapheading">Chapter 355</h2>
<p class="content">This is normal content typically seen on the Kindle. It has a 16px font at default settings1. It's important that you pay attention to text size throughout your eBook. CSS makes short work of this task.</p>
<h3 class="appendixheading">Footnotes</h3>
<p class="footnote">1May be adjusted by reader</p>
And the CSS:
h2.chapheading {font-size: 1.5em;}
h3.appendixheading {font-size: 1.25em;}
p.content {font-size: 1.0em;}
p.footnote {font-size: 0.8em;}
eBook of Varying Font Sizes

While the sizes are appropriate, one thing that looks unseemly in this example is the footnote number. Footnotes are typically in superscript at a font-size of about 60% (or 0.6em). To superscript the number, you simply use a span element to wrap around it, and use the declaration vertical-align: super;. You can also use this property to declare any other text that should be superscripted.

Some example HTML and CSS would be as follows:
<p class="content">This is normal content typically seen on the Kindle. It has a 16px font at default settings <span class="footnoteindex">1</span>. That is my 1<span class="footnoteindex">st</span> footnote.</p>
The CSS:
p.content {font-size: 1.0em;}
span.footnoteindex {font-size: 0.6em; vertical-align: super;}

Font Sizes with Superscript Support

Important Note: Keep in mind when designing eBooks for the older e-ink Kindles that they often render slightly different em values at the same exact size (e.g. 1.0em and 0.9em font-sizes both appear as 1.0em). The Kindle Fire does not have this bug. Trial and error using the Kindle Previewer is essential in ensuring the text is correctly sized on the e-ink Kindles.
Bug on e-ink Kindles with Font Sizing

Tracking


Tracking is another typographical term defining a fixed space between letters. While leading is spacing on the vertical axis for a paragraph of text, tracking is spacing on the horizontal axis. The CSS property for tracking is letter-spacing: value;, where value is a relative em value. The default percentage is 0em, so a negative value would bring letters closer together, while a positive value would push them further apart.

Some sample HTML and CSS where tracking of varying amounts is applied is as follows:
<p class="smalltracking">This is a paragraph with some squished tracking.</p>
<p class="widetracking">This is a paragraph with some wide tracking you could drive a truck through.</p>
<p>This is a paragraph with default tracking, which is generally fine.</p>
The CSS:
p.smalltracking {letter-spacing: -0.1em;}
p.widetracking {letter-spacing: 0.1em;}
p {letter-spacing: 0em;}
Varying Levels of Tracking


While you are unlikely to have to adjust the tracking on a regular basis, it may be useful for specialized eBooks such as poetry collections or excerpting content from a newspaper to give that "old-timey" look.

Changing Colors


Using different colors was pretty much an exercise in futility a few years back, when virtually all eBook reading devices were grayscale. However, with the introduction of the Kindle Fire and the popularity of the iPad (which has the Kindle iOS app), it is now worthwhile to jazz up your eBook by adding some colors to your text. This statement should come with a word of caution. Back in the mid-1990s when the internet primarily consisted of Captain Kirk fanfic, colors were used and abused on websites to create content with seriously tacky presentation (blinking text anyone?). The big publishing houses have kept things simple by designing their eBooks with all-black text. However, don't be afraid to think outside of the box. Adding color to your text may be useful if you are working on designing something like an electronic textbook.

To add color to your CSS, you use the color: value; declaration. The value can either be one of the 143 predefined color names (e.g. navy, pink, black) or a # sign preceding a six-character hexadecimal code, which allows for over 16 million different colors (e.g. #000000 for white). These values can be easily generated on a number of sites online or using open source software.

Some sample HTML and CSS with different colors is as follows:
<p class="content">This is the final sentence in your textbook.</p>
<h2 class="redheading">Exercises for Your Teams</h2>
<ol>
<li>The <span id="blueteam">Blue team</span> should focus on…</li>
<li>The <span id="purpleteam">Purple team</span> should focus on…</li>
</ol>
The CSS:
p.content {color: black;}
h2.redheading {color: red;}
span#blueteam {color: #237DE4;}
span#purpleteam {color: #9123E4;}
Experimenting with Text of Different Colors
Next Post: Understanding the CSS Box Model
Share/Bookmark

February 23, 2012

Adding Hyperlinks to Your Kindle Fire eBook


Thank you for visiting this eBook design tutorial. We now have an eBook design startup—BB eBooks—dedicated to helping independent authors and small presses get their eBooks formatted, converted, and ready for sale at all the major online retailers (e.g. Amazon's Kindle Store, Barnes & Noble's Nook, iBookstore, Smashwords, etc.) Please contact us for a no-obligation quote. For those writers, editors, and publishers looking to go the DIY route for eBook production (you probably are if you visited this page), we offer free online tutorials and apps to help you professionally design your eBook. Please visit our Developers page and let’s work together to improve the overall standards of eBooks. Also, please sign up for the mailing list for promotions, design & marketing tips, plus eBook industry news.



Looking for a complete guide on eBook design and development? Please consider The eBook Design and Development Guide, which contains everything you need to know about HTML, CSS, EPUB, and MOBI/KF8 to make an eBook like a pro. Pick it up at Amazon for $6.99 today.

Previous Post: Lists

Everyone likes functionality in their eBooks and being able to visit other sites on the web with the tap of a finger. By adding an element of interactivity, hyperlinks give eBooks a serious edge over their dead tree cousins. A hyperlink consists of two parts: the hyperlinked content that is clicked to access the hyperlink and the target. For example, by clicking this hyperlinked content, you will go to the author's blog at http://paulsalvette.com. Hyperlinks can also redirect the reader to sections inside the actual eBook—a necessity for building a proper Table of Contents.

External Hyperlinks


For hyperlinks outside of the eBook, you can designate targets as either websites (http://website.com) or email addresses (mailto:name@domain.com). Be sure to add the http:// or mailto: before your hyperlinks, or else your HTML markup will fail EPUB validation. The HTML markup to add a hyperlink is an in-line element with the following syntax: <a href="http://website.com">hyperlinked text</a>.

Getting back to the elf story, suppose you want to hyperlink the phrase “Joe Selfpubber” with an email address that opens the eReading device's email application and "Drop him a line" with a hyperlink that goes to the author's website. The HTML markup would be as follows:
<p><a href="mailto:joeselfpubber@gmail.com">Joe Selfpubber</a> is trying to make it big by selling his eBooks on the Kindle Fire so that he can quit his lousy day job. <a href="http://joeselfpubber.com">Drop him a line sometime</a>.</p>

Adding Hyperlinks with HTML

By default, most web browsers and eReading devices will render hyperlinked text blue and underlined. You can alter this presentation using CSS. By clicking on “Drop him a line sometime”, you will be taken to http:// joeselfpubber.com, and by clicking “Joe Selfpubber”, it will pull up the eReading device's or computer's email client with “joeselfpubber@gmail.com” in the TO: block.

Tip: Hyperlinks offer the opportunity to link to content outside of the eBook that may be of interest to your readers, as well as a chance to content market your own goods and services. Do not pass up the occasion to utilize hyperlinks extensively.

Important Note: Some websites use ampersands within the URLs for certain links. In order for your markup to be valid, you need to convert the ampersands into HTML entities (i.e. &amp;) or use percent encoding (i.e. & should be changed to %26).

Internal Hyperlinks


Internal hyperlinks target specific content within the eBook itself, permitting the reader to jump from section to section. To define where the hyperlink should target, you must establish anchors within your eBook. This is accomplished using the id="anchorname" attribute, which can be placed inside almost any HTML tag (e.g. <p>, <div>, <span>, <a>, etc.). The id attribute is also important in styling your content with CSS.

Establishing the hyperlink to target the anchor is done in a similar fashion as hyperlinking to external content. The anchorname defined in the id attribute gets targeted by using the # key. For example, <a href="myebook.html#anchorname">hyperlinked text</a> would target the content with the id="anchorname" attribute inside the myebook.html file. You should use a relative path for the .html file.

Here is an example of adding anchors and internal hyperlinks to your HTML markup in a file called myebook.html:
<p id="section1">This is the 1st paragraph.</p>
<p>By clicking on this <a href="myebook.html#section1">link</a>, you'll go back to the 1st paragraph.</p>

By clicking on the hyperlinked text, the web browser or eReading device will go back to the first paragraph. You will notice that the value of the id attribute is completely transparent to the reader.
Internal Hyperlink Example in Google Chrome

Important Note: The value of the id attribute must be labeled uniquely throughout the HTML document. Also, it must not start with a number or special character (e.g. 1anchorname, $anchorname, etc.)

Internal Hyperlink Bug in Kindle


There is a bug in the way the KF8/MOBI format is compiled that provides such a poor reading experience a section must be devoted to its awareness. Technically, you can specify an anchor with in-line HTML markup like <a id="anchor1" /> or <span id="anchor1">some text</span>. However, when the reader clicks on a hyperlink to this anchor in the older e-ink Kindles or the Kindle apps, it will completely mangle the formatting of the target text that is designed using CSS. Sadly, this problem was not corrected by Amazon in their most recent release of the KindleGen software.

This is problematic because you often want your internal hyperlinks to target specific chapter headings. For example, the design of this sample novella has CSS to style it, and there is an in-line HTML anchor within the HTML markup for the heading:
<p class="chapheading"><a id="chap3" />Chapter 3<br />Las Vegas</p>
If a hyperlink to #chap3 is clicked on within any Kindle device, except the Kindle Fire, the following bug occurs where the formatting is completely blown out:
Bug with Internal Hyperlinks Example on the Kindle for iPhone


To avoid this only use the id attribute within block elements. To be safe you can wrap <div></div> tags around the entire heading and insert the id attribute to define the anchor. The HTML markup for this particular case would look as follows:
<div id="chap3"><p class="chapheading">Chapter 3<br />Las Vegas</p></div>
This method of including the id attribute in a separate <div> element will avoid the Kindle bug.

Tip: In addition to defining anchors within the <div> element, be sure to label your anchors in a logical fashion to help yourself in the design process and workflow.

Next Post: Basic CSS
Share/Bookmark