I am using reveal.js to create HTML slide shows. By default (and with all the themes I tried) reveal.js layouts the complete content of each slide in a vertically centred manner. It looks somewhat like this:
How can I set a CSS rule for the h1 header or for one of the other reveal.js selector, so that the h1
header stays at the top of the slide while the rest is still vertically centered? I mean something like this:
I tried a few things by now. For example
.reveal h1 {
position: absolute;
}
doesn't work, because with this the header does not "get out of" the vertically centred section
.
I also played with changes up the hierarchy:
.reveal .slides {
position: static;
}
(plus the h1
CSS from above), but I could not make it work either.
Finally I tried from one answer the transform approach, but this doesn't work either - probably because reveal.js already uses transform itself.
Any idea how to do this in reveal.js?
absolute
orrelative
, you are stuck inside this context for positioning child elements. What do the CSS rules for theh1
and.slide
elements look like? – Pestiferoush1
has (at the moment) nopostion
,.reveal.slide
has (deep inreveal.css
){backface-visibility: hidden;}
. - Not sure if that helps. – Izaak