conditional statement for screen resolution?

后端 未结 3 466
慢半拍i
慢半拍i 2020-12-31 12:36

I would like to use a conditional statement to attach a different stylesheet for:

if the clients resolution is <= 1024*768

I\'m pretty sure t

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 13:11

    CSS 3 introduces media queries, but it is new and support is not all that widespread yet (Firefox only introduced it in version 3.5, for instance, and Internet Explorer won't get it until version 9) so build with progressive enhancement in mind. CSS Tricks has a tutorial for providing different CSS for different browser window sizes (which is a more useful metric then display resolution).

    You can test support for your browser.

提交回复
热议问题