How would you write media queries for multiple screen sizes?

前端 未结 5 1843
孤城傲影
孤城傲影 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:57

    Apply this code.

    @media only screen and (max-width:319px)  { body{font-size:11px}}
    @media only screen and (min-width:320px) and (max-width:767px)  { body{font-size:12px} }
    @media only screen and (min-width:768px) and (max-width:1023px)  { body{font-size:14px} }
    @media only screen and (min-width:1024px) and (max-width:1899px) { body{font-size:16px} }
    @media only screen and (min-width:1900px) { body{font-size:18px} }
    

提交回复
热议问题