Forum How do I...?

Handle class differently on first page

twantzen
Is it possible to handle a specific class differently on the first page of a document?

Let's say we have:

<section class="contentBottom">Blablablabla</section>


with

.contentBottom {
   margin-top: 3.5em;
}
@page:first {
   .contentBottom {
      float: bottom;
      margin-top: 0;
      margin-bottom: 5mm;
   }
}


This doesn’t work, but illustrates, what I’m looking for.

Thanks for your help!
Tobias
mikeday
Unfortunately not. If you know that the section will definitely appear on the first page then you could simply select the first section, but if you don't know if it will appear on the first page or not then you would need to use a two-pass JavaScript process to check this.