即使我设置了html字体大小,REM大小也没有更新

时间:2018-05-22 05:31:47

标签: css css3 font-size

我已将html和正文设置为<div class="row"> <div class="col-lg-3"> <div class="side-left-btn" onclick="showHide()"> <?php // WP_Query arguments $args = array( 'post_type' => array( 'Exhibition' ), ); // The Query $exhibition = new WP_Query( $args ); // The Loop if ( $exhibition->have_posts() ) { while ( $exhibition->have_posts() ) { $exhibition->the_post(); ?> <button class="btn btn-inner" id="uik"><?php the_title(); ?></button> <?php } wp_reset_postdata(); } ?> </div> </div> <div class="col-lg-9"> <?php // WP_Query arguments $args = array( 'post_type' => array( 'Exhibition' ), ); // The Query $exhibition = new WP_Query( $args ); // The Loop if ( $exhibition->have_posts() ) { while ( $exhibition->have_posts() ) { $exhibition->the_post(); ?> <div id='hidden_div' style='display:none;'> <?php the_post_thumbnail( 'medium', array( 'class' => 'img-inner', 'id' => 'imgss', ) ); ?> <script type="text/javascript"> function showHide() { document.getElementById("hidden_div").style.display = "block"; } </script> </div> <?php } wp_reset_postdata(); } ?> </div> </div>

enter image description here

然后我将元素的一些填充设置为15px,这应该转换为1rem。但相反,它给了我15px ...

enter image description here

知道为什么吗?

-

浏览器:Google Chrome。 MacOS的。
CSS:手写笔
框架:Vue.js + NUXT

1 个答案:

答案 0 :(得分:0)

答案是设置以下内容:

:root {
    font-size: 15px;
}