1.8

Table Of Contents
Conditionally formatting Master Page objects
The following CSS rule sets the color of <h1> elements on a Master Page when that Master
Page is present on the front of a sheet.
.frontside h1 {
color: green;
}
The next style rule is a bit more specific: it colors <h1> elements on a Master Page when that
Master Page is applied to the front of a sheet in Section 1:
[section='Section 1'] .frontside h1 {
color: green;
}
The following rule hides <h1> elements on the back of a sheet on which no content (from the
main text) is allowed.
.backside.nocontentpage .h1 {
display: none;
}
Print section background selector
When you inspect a Print section in a browser, you will see that it has a <div id="pages">
element as the first child of the <body> element. Inside this <div> there are one or more
MediaBoxes: elements with the class page_mediabox. Each MediaBox contains the Media,
section background and Master Page that apply to one page (see "Media" on page353,
"Master Pages" on page350 and "Using a PDF file as background image" on page339).
In the MediaBox, a Print section background is an <img> element with the ol_pdf_datamapper_
input class. Its src attribute references the PDF file that contains the image and its page
attribute is used to select a specific page in that PDF (as a PDF can contain more than one
page). For example:
<img src="file:/C:/Users/MyUser/Pictures/mixed.pdf?page=1" class="ol_pdf_datamapper_
input">.
You can use the ol_pdf_datamapper_input class as a selector to target the section background
in a style rule or script.
Placing the section background in front of the Master Page
The stacking order of elements inside each MediaBox, from bottom to top, is:
Page 663