html5 - Phonegap css background image dpi -
i building phonegap app ios , having problems css image backgrounds. example have div spans on 100% of viewport. want use real resolution images pixel perfection.
<div class="main"></div> <style> .main { width: 100% height: 100%; background: transparent url('640×1136.jpg') } </style>
so want display 640×1136 image background. viewport 320px wide making background image stretched.
can somehow make web view use real pixels instead?
you can use background-size attribute:
background-size: contain
or:
background-size: cover
you have more information in "background-size"
Comments
Post a Comment