How does reveal.js resize elements?

前端 未结 4 854
[愿得一人]
[愿得一人] 2021-02-02 17:22

I am trying to understand how reveal.js resizes elements dynamically.

To see this, adjust the height of the page and see how elements (to a certain degree) shrink as the

4条回答
  •  孤独总比滥情好
    2021-02-02 17:50

    Have you heard of media queries? This is a technique deployed through CSS that allows you to affect the styling of elements based on the width and height of the window. Here is how it's used for reveal.js https://github.com/hakimel/reveal.js/blob/master/css/reveal.css

    @media screen and (max-width: 900px), (max-height: 600px) {
        .reveal .slides {
            font-size: 0.82em;
        }
    }
    
    @media screen and (max-width: 700px), (max-height: 400px) {
        .reveal .slides {
            font-size: 0.66em;
        }
    }
    

    Read On: MDN CSS Media Queries

    Mini Tut: CSS Media Queries & Using Available Space | CSS-Tricks

提交回复
热议问题