I was able to add a header to my slide design/layout by simple adding a
Need a better solution. My simple adding of a div before the textarea doesn't scale if you change to 4:3 ratio. What's a simple way of adding a permanent header and footer area as a style template to each slide?
You should never add stuff outside of the <textarea>. What you want to do is use the layout slide property to define an initial template slide that contains the common header that will be included in all following slides (until a new layout slide is defined, or the layout: false is used to deactivate it).
https://github.com/gnab/remark/wiki/Markdown#layout
As for the footer the easiest is probably to add a <div class="footer">your footer text</div> in the layout slide, and use CSS like .footer { position: absolute; bottom: 12px; left: 20px } to position it correctly.
Perfect! Thank you!
I can't seem to figure out how to put an image in the footer.
Could you maybe point me in the right direction?
@arioch This is what I have. It's an image in the header but I'm sure you can adjust to an image in the footer easily enough. There's a gradient from white to orange in my header.
<link rel="stylesheet" type="text/css" href="my-remark.css"/>
<body>
<textarea id="source">
layout: true
<div class="my-header"><img src="images/logo_tiny.png" style="height: 30px;"/></div>
<div class="my-footer"><span>© 2011 - 2015 My Company, Inc.</span></div>
---
class: center, middle
Title Page
---
## Table of Contents
Slide 2
</textarea>
==== CUT my-remark.css =====
/* Header/Footer stuff */
div.my-header {
background-color: #F77A00;
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#ffb76b), color-stop(0%,#ffa73d), color-stop(0%,#ffffff), color-stop(10%,#ffffff), color-stop(25%,#F77A00), color-stop(100%,#F77A00));
position: fixed;
top: 0px;
left: 0px;
height: 30px;
width: 100%;
text-align: left;
}
div.my-footer {
background-color: #F77A00;
position: absolute;
bottom: 0px;
left: 0px;
height: 20px;
width: 100%;
}
div.my-footer span {
font-size: 10pt;
position: absolute;
left: 15px;
bottom: 2px;
}
That's pretty much what I was looking for, thanks!
Most helpful comment
You should never add stuff outside of the
<textarea>. What you want to do is use thelayoutslide property to define an initial template slide that contains the common header that will be included in all following slides (until a new layout slide is defined, or thelayout: falseis used to deactivate it).https://github.com/gnab/remark/wiki/Markdown#layout
As for the footer the easiest is probably to add a
<div class="footer">your footer text</div>in the layout slide, and use CSS like.footer { position: absolute; bottom: 12px; left: 20px }to position it correctly.