Forum How do I...?

help controlling vertical margin of @top css elements

mbaker00
In my css I have rules that create a top page margin of .75 in. globally, then more specifically for a title page of 5cm and the first right sided page of a main content page of 10cm. As the top margin in the different sections moves down, the @top-left and @top-right content also moves down to the half-way point between the
@page margin-top and the physical page top margin. Is this spacing controllable? I'll just include the @page css unless that's insufficient to start. If necessary I can attach images in follow-up post.
Thanks
Michael

@page {
  size: 8.5in 11in;
  margin-top: 0.75in;
  margin-bottom: 0.75in;
  counter-reset: footnote;
}
@page {
	@footnotes {
		border-top: solid black thin;
        float: bottom;
		border-clip: 100px 100px;
    	padding-top: 6pt;
    	margin-top: 6pt;	}
}
@page titlePage {
  @top-left { content: normal }
	@top-right {content: normal }
  border: 1pt red solid;
}

@page mainContent:left {
  @top-left { content: counter(page) }
	@top-right { content: string(book-title) }
    margin-left: 1.35cm;
    margin-right: 2.75cm;
    font-size: 10pt;
}
@page mainContent:right {
  @top-right { content: counter(page) }
	@top-left { content: string(header) }
    margin-left: 2.75cm;
    margin-right: 1.35cm;
    font-size: 10pt;
}
@page mainContent:right:first {
  margin-top: 5cm;
}
@page mainContent:blank {
	@top-right {content: normal; }
  @top-left {content: normal; }
}
@page:blank {
  @top-left {content: normal; }
	@top-right {content: normal; }
	}
@page :first {
  margin-top: 10cm;
}
mikeday
You can apply "vertical-align: top" or "vertical-align: bottom" to the @page margin box content.
mbaker00
Thank you for the answer. I tried the following and it works like I wanted. I assume this is what you were suggesting.
@page {
  @top-left  { vertical-align: top; padding-top: .3in; }
  @top-right { vertical-align: top; padding-top: .3in; }
}


I guess this means the default is vertical-align: middle; ?

It looks like I posted this in the wrong forum. Seems to be showing in News instead of How Do I ..? I'm sorry about the mistake. Not sure how to fix it.

Cheers,
Michael

Edited by mbaker00

mikeday
Yes, that is correct. (I've moved the post :))