4

I am working with EPUB 2 specifications and I am trying to determine whether or not the content property is supported in EPUB2. I know that it is for EPUB 3 - http://www.idpf.org/accessibility/guidelines/content/style/reference.php#css025-css21

I am using the content property to generate txt break symbols e.g. "*"

I can see them in my web browser but they are not showing up on my devices or previewers. There is just a blank space with no asterisks.

.TXBDINGBATS { font-family: SAT_disp_bold;

font-size:1.05em;
line-height: 1.4em;

text-align: center;
margin: .5em 0 .5em -1.3em;
text-indent: 0;

content: "\2217 \a0 \a0 \a0 \a0 \a0 \2217 \a0 \a0 \a0 \a0 \a0 \2217";
}

  • Bear in mind the following, which is at the top of the page that you linked to: "EPUB 3 reading systems that visually render content are expected to provide support for the CSS properties listed on this page, but support is not required." In practice, I would be surprised to find any major reading systems, with the possible exception of iBooks, that support content, but I have not done any testing to be able to say for sure. – Tom Jul 2 '14 at 0:02
2

EPUB 2 specifies content as supported property in the list of CSS properties.

However, it is based on CSS 2.1, where the content property is allowed only for :before and :after pseudoelements. As the linked EPUB 3 spec shows (by linking to CSS 2.1), the same restriction applies in EPUB 3.

Thus, the code in the question won’t work, to the extent that it relies on the content property. Moving the declaration to apply to a pseudo-element, if applicable, should work in conforming software:

.TXBDINGBATS:before {
  content: "\2217 \a0 \a0 \a0 \a0 \a0 \2217 \a0 \a0 \a0 \a0 \a0 \2217";
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.