single fixed page

2 posts / 0 new
Last post

Hi All

I am struggling with a particular publication feature.
The book designer requires a particular type of pages inside of a reflowable epub.
The page should be a page with background *completely* covered with color.
Say a white text on a blue background. The background should fill the page 100% in width and height.

I could not find a good way of doing so. I ended up using style
{
position: fixed;
width: 100%;
height: 100%;
}
This correctly works except when a reader increases the text size, the text may scroll beyond the visible area and disappear and there's no way to reformat it two pages for example.

Does anyone know of a right way to achieve the desired?
Any help will greatly appreciated!

Dmitry

Well, there are different options to get this and one major problem with several EPUB-viewers:
They often do not care about CSS a lot, especially for background color and foreground color,
therefore one cannot rely on what is formally right in CSS for presentation.
What is formally ok for viewers with a correct basic CSS interpretation for an XHTML-document:
html, body {background: blue; color: white}
In general for XHTML it should be sufficient to write this for the html element, but there are some special rules for HTML documents, therefore just in case to avoid bugs in viewers, one can add it for the body element as well.
If a viewer already fails for such simple CSS 1.0, obviously there is not much use for more advanced CSS ;o)

However, if viewers fail or CSS interpretation is switched off (what is ok, if done by the user),
this might be ignored, finally CSS is only decoration, as java-script is as well.
Therefore one must not rely on this.

If color really matters for understanding of the content, this is a hint, that the content is more
graphics than textual information. If there is not much text, but mainly graphics, using SVG is
a good option, if one uses presentation attributes and not CSS properties to provide color
information, this is a hint, that the color really matters for content and is not just decoration.

Secondary menu