Quote:
Originally Posted by ElMiko
I would like to simulate the effect of overwritten text, as one might seen on a typewriter where two (or more) characters have been struck over the other(s). Do existing epub2 and epub3 e-reader allow for this effect?
my current idea is to use "letter-spacing" like this:
Code:
.ow {
letter-spacing: -0.65em;
margin: 0 0.25em;
}
.ow2 {
margin: 0 0.25em;
}
Code:
<p>I have <span class="ow">tx</span><span class="ow">ox</span><span class="ow2"> </span>go.</p>
which produces text that reads "I have to go" with the "to" overlapped by "xx" in Preview and PageEdit. Obviously, the spacing is going to be sensitive to different font-families and kerning within the font-family itself (if it isn't monospace), but would this even render as desired in actual e-reading software/hardware in theory?
Alternately, is there a better CSS solution?
|
The easiest way, that is supported by epub2/epub3, is by employing the property "display: inline-block". For example:
Code:
<p>This text is<span class="over">overwritten</span> and this is not overwritten.</p>
Code:
.over {
display: inline-block;
margin-left: -5em; /* or what you wish */
}