2017-04-11 42 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

回答