How to Make Slides with CSS
impress.js is a presentation framework based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com.
CSS is supported by impress
to style slides.
Startting
To use this library, you need to download codes from GitHub, and include impress.js
at the end of HTML file.
1 | <script src="js/impress.js"></script> |
HTML class elements
Every single slide has to be tagged with class="step"
, and then impress.js
will render it.
1 | <div id="imagination" class="step" data-x="6700" data-y="-300" data-scale="6"> |
data-x
, data-y
are coordinates for a single slide. (0,0) is screen center.data-scale
defines the scaling multiplier of elements. data-scale="6"
means 6 times larger than others.data-rotate
represents the amount of clockwise rotation of the element relative to 360 degrees.data-z
represents depth distance of elements. data-z="-3000"
means that element is positioned far away from the camera (by 3000px). This is useful to show hierarchical relations between slides.
Style slides
Font family and background
1 | body { |
Links format
1 | a { |
Global style
1 | .step { |
Transperent inactive step
1 | .impress-enabled .step { |
Normal slide style
1 | .slide { |
States styling
.future
class is added to all elements that havn’t been visited yet. .present
class is added to the step
currently on show. .past
class is added to all the elements have been visited.
1 | .past { |
3D clickable in Chrome
1 | .impress-enabled { pointer-events: none } |
Overview
1 | #overview { display: none } |