how to get retina-ready? [closed]

陌路散爱 提交于 2020-01-11 04:09:07

问题


what do I have to do to make my web apps/sites retina-ready (on iPhone4 & iPad3) when it comes to

  • videos
  • images
  • fonts
  • colors ?

I'm looking for a checklist here.


回答1:


If you're on Rails 3.1+, you can use my clear_eyes gem to automatically handle retina images.

Colors and fonts won't need any adjustments. For example, a CSS button will not require any adjustment, only images and perhaps video.

Here's a very good flowchart of the steps required to completely retina-fy your site, although I recommend using the gem for images, if you're on Rails.




回答2:


Smashing Magazine: Towards A Retina Web (mostly about graphics)




回答3:


for image:

<script>if(window.devicePixelRatio>1)document.getElementsByTagName("img")[0].src="retina.png"</script>

for backgrounds:

<style>
  @media screen and (-moz-min-device-pixel-ratio: 2),
    screen and (-o-min-device-pixel-ratio: 2/1), 
    screen and (-webkit-min-device-pixel-ratio: 2), 
    screen and (min-device-pixel-ratio: 2){

      h1{background-image:url(retina.png)}

  }
</style>


来源:https://stackoverflow.com/questions/9748252/how-to-get-retina-ready

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!