Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I put a caption on the lower right in Reveal.js?

Tags:

css

reveal.js

I have a Reveal.js slide show that uses a lot of background images:

<section data-background="latimes.png">
    <small class="caption">[Some Text](http://a.link.com/whatever)</small>
    <aside class="notes">some notes</aside>
  </section>

And I'd like to put a caption/link for each image on the lower left-hand corner of each slide.

I tried setting a custom class

.reveal .caption a {
  background: #FFF;
  color: #666;
  padding: 10px; 
  border: 1px dashed #999;
}

.reveal .caption {
  postion: absolute; 
  bottom: 0px;
  left: 50px;
}

But it doesn't seem to have any impact on the layout. The element inspector doesn't seem to work well with Reveal.js, which makes this hard to troubleshoot. Is there a good way to force a block of text to a corner of the screen in reveal.js?

like image 789
Amanda Avatar asked May 08 '14 13:05

Amanda


1 Answers

The reason this might be a bit tricky is because the parent nodes have some set defaults.

Set width and height to 100% in initialization of Reveal:

Reveal.initialize({
    width: "100%",
    height:"100%"
});

Ensure that the slide (ie. section) uses the whole space:

.full {
    height:100%;
    width:100%;  
}

and finally set the position of the caption:

.caption {
     bottom:0px;
     right:0px;
     position:absolute;
}

full code

like image 74
M.T Avatar answered Oct 24 '22 06:10

M.T