2022.2

Table Of Contents
Formatting Master Page objects depending on the sheet position
ThefollowingCSSrulesetsthecolorof<h1>elementsonaMasterPagewhenthatMasterPageis
presentonthefrontofasheet.
.frontside h1 {
color: green;
}
Thenextstyleruleisabitmorespecific:itcolors<h1>elementsonaMasterPagewhenthatMaster
PageisappliedtothefrontofasheetinSection1:
[section='Section 1'] .frontside h1 {
color: green;
}
Thefollowingrulehides<h1>elementsonthebackofasheetonwhichnocontent(fromthemaintext)
isallowed.
.backside.nocontentpage .h1 {
display: none;
}
Print section background selector
WhenyouinspectaPrintsectioninabrowser,youwillseethatithasa<divid="pages">elementas
thefirstchildofthe<body>element.Insidethis<div>thereareoneormoreMediaBoxes:elements
withtheclasspage_mediabox.EachMediaBoxcontainstheMedia,sectionbackgroundandMaster
Pagethatapplytoonepage(see"Media"onpage144,"MasterPages"onpage141and"UsingaPDF
fileorotherimageasbackground"onpage130).
IntheMediaBox,aPrintsectionbackgroundisan<img>elementwiththeol_pdf_datamapper_input
class.ItssrcattributereferencesthePDFfilethatcontainstheimageandthepageparameterisused
toselectaspecificpageinthatPDF(asaPDFcancontainmorethanonepage).
Forexample:
<imgsrc="file:/C:/Users/MyUser/Pictures/mixed.pdf?page=1"class="ol_pdf_datamapper_input">.
Youcanusetheol_pdf_datamapper_inputclassasaselectortotargetthesectionbackgroundina
styleruleorscript.
Placing the section background in front of the Master Page
ThestackingorderofelementsinsideeachMediaBox,frombottomtotop,is:
Page 388