2017-04-11 41 views
1

我有以下基本页面,我想设置320px的媒体中断点,但希望根字体大小为14px,我已设置。为什么我的断点仍然设置为16px x 22.8em = 364.8px而不是14px x 22.8em = 319.2px?如果我从rem改为em,我会得到同样的结果。css em/rem固定乘以16?

<!doctype html> 
<html> 
<head> 
<meta charset="UTF-8"> 
<title>#</title> 

<style type="text/css"> 
html { 
    font-size: 14px; 
} 

@media (min-width: 22.8rem) { 
    html { 
    font-size: 4rem; 
    } 
    } 
</style> 

</head> 

<body> 
    <p>This is some text</p> 
</body> 
</html> 
在媒体查询
+0

我知道em用于包含元素,rem用于根元素。 – sansSpoon

+0

对不起,但我认为不应该根据字体大小来移动断点。如果你的字体大小是12px,那么你的电脑屏幕不会变小。断点=不同的设备宽度 – Justinas

回答