How would you write media queries for multiple screen sizes?

前端 未结 5 1892
孤城傲影
孤城傲影 2021-02-01 09:08

If i want

body {font-size:18 px} for 1900 and above

body {font-size:16 px} for 1024 and 1900

body {font-size:14 px}

5条回答
  •  执念已碎
    2021-02-01 09:59

    This should do the work

    @media only screen and (min-width: 320px)  { body{ font-size: 12px; } }
    @media only screen and (min-width: 768px)  { body{ font-size: 14px; } }
    @media only screen and (min-width: 1024px) { body{ font-size: 16px; } }
    @media only screen and (min-width: 1900px) { body{ font-size: 18px; } }
    

提交回复
热议问题