The Design and Construction of eBooks, by Steve Thomas

Images

Books can feature a variety of types of images, and I have developed a number of classes to cater for them.

Illustrations

The simplest case is an illustration inserted between paragraphs of text, intended to illustrate some aspect of the text. This can be coded using the “illustration” class, and is styled as follows:

img { border:none; max-width:100%; }

.illustration {
    margin:1em auto;
    max-width:100%;
    text-align:center!important;
}
.illustration p {
    font-size:.9em;
    font-variant:small-caps;
    text-align:center!important;
    text-indent:0!important;
}

Notice that the maximum width is 100%, so that an image doesn’t unintentionally overflow the page, and that the image is centered on the page. We also allow for a text caption, styled to be differentiated from the body text.

Horus, Son of Isis, introducing the Scribe Ani to Osiris.

Horus, Son of Isis, introducing the Scribe Ani to Osiris.

[From the Papyrus of Ani. Brit. Mus., Pap., No. 10470.]

For semantic purposes, there are also classes named map, figure, frontispiece, and plate. These are styled as for illustration, with the exception that frontispiece and plate will force a page break if printed.

Ornaments

A second class of image is the ornament. Unlike the illustration, which illustrates some point in the text, ornaments are purely decorative. They’re unimportant, except in so far as they add to the aesthetic quality of a work, and generally appear at the start and end of a chapter, or as section dividers. For example, using the “ornament” class:

ornament

For essentially semantic purposes, I also use the more specific class names headpiece and tailpiece for those images specifically used at the start and end of a chapter.

Here’s a sample headpiece:

ornament

. . . and a sample tailpiece.

ornament

Embedded figures

There are also two classes for figures that are embedded within the text, to the left or right, with the text wrapped around them, as shown below.

.figleft, .figright {
    font-size:.9em;
    font-variant:small-caps;
    max-width:50%;
    text-align:center!important;
    text-indent:0!important;
}
.figleft {
    float:left;
    margin:0;
    padding:.5em .5em .5em 0;
}
.figright {
    float:right;
    margin:0;
    padding:.5em 0 .5em .5em;
}

Sed ut perspiciatis, unde omnis iste natus error sit voluptatem
Fig. 6.
accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione Bernhardt as Salome voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur?

https://ebooks.adelaide.edu.au/about/part2.8.html

Last updated Tuesday, January 26, 2016 at 23:27