/*1、width: viewport的宽度,css像素,三星S3的viewort默认宽度是980px。
当设置viewport width=device-width时,对应的媒体查询中width的值为:设备物理像素 / window.devicePixelRatio。
----------------------------------------------------------*/
@media screen and (width:360px){
body{ background-color:#0f0; }
}
/*2、device-with: 屏幕宽度,android上是设备像素,ios上是css像素。
三星S3的屏幕是720*1280媒体查询代码如下:
----------------------------------------------------------*/
@media screen and (device-width:720px){
body{ background-color:#ff0; }
}
/* iphone显示屏的设备像素是640*960,css像素320*480。
媒体查询代码如下:
-------------------------------------------------------*/
@media screen and (width:320px){
body{ background-color:#ff0; }
}
/*3、resolution: 设备分辨率,每英寸所拥有的像素数。如:
----------------------------------------------------------*/
@media screen and (resolution:306dpi){
body{ background-color:#000; }
}
媒体查询的device-width特性在ios和android上不一致,android是应用设备像素,ios是应用css像素。
另外resolution浏览器支持不够好,可以使用device-pixel-ratio代替,device-pixel-ratio的值为 window.devicePixelRatio
- 浏览: 260141 次
- 性别:
- 来自: 北京
最新评论
-
haixin3036:
jQuery是一套跨浏览器的JavaScript库,简化HTM ...
jquery sizzle 选择器浅析 -
panshunchang:
非常感谢分享,正找这东西呢。
基于jQuery的QQ表情插件 -
yuur369:
不错。。。
移动端webapp开发必备知识
移动WEB开发中媒体查询里的width, device-width, resolution
- 博客分类:
- jquery
- javascript
相关推荐
� 谷歌长期以来奉行的移动发展战略:通过与全球各地的手机制造商和移动运营商结成合作伙伴,开发 既 有用又有吸引力的移动服务,并推广这些产品。 Android 进一步推进了 " 随时随地为每个人提供信息 " 这一企 业 ...
-Supports all devices such as hard drives, DVD, mice, scanners, web cams -Capture megabytes of I/O at a time -View I/O in real time -Supports every release of Windows 95, 98, Millennium, NT 4.0, ...
lcd_width: width of lcd in mm ;lcd_height: height of lcd in mm ;lcd_dclk_freq: in MHZ unit ;lcd_pwm_freq: in HZ unit ;lcd_pwm_pol: lcd backlight PWM polarity ;lcd_pwm_max_limit lcd backlight PWM max ...
1、干掉设置中的BT蓝牙选项: R:\wyb\rtl8188eu_sina33m_sc3817\android\device\softwinner\astar-d7\overlay\frameworks\base\core\res\res\values\config.xml <!-- List of regexpressions describing the ...
{****************************************************************************** * * * PROJECT : EOS Digital Software Development Kit EDSDK * * NAME : EDSDKApi.pas * * * * Description: This is the ...
DEVICE_PACKAGE_OVERLAYS := device/softwinner/astar-y3/overlay PRODUCT_CHARACTERISTICS := tablet # Overrides PRODUCT_AAPT_CONFIG := xlarge hdpi xhdpi large PRODUCT_AAPT_PREF_CONFIG := xhdpi PRODUCT_...
DEVICE_PACKAGE_OVERLAYS := device/softwinner/astar-y3/overlay PRODUCT_CHARACTERISTICS := tablet # Overrides PRODUCT_AAPT_CONFIG := xlarge hdpi xhdpi large PRODUCT_AAPT_PREF_CONFIG := xhdpi PRODUCT_...
DEVICE_PACKAGE_OVERLAYS := device/softwinner/astar-y3/overlay PRODUCT_CHARACTERISTICS := tablet # Overrides PRODUCT_AAPT_CONFIG := xlarge hdpi xhdpi large PRODUCT_AAPT_PREF_CONFIG := xhdpi PRODUCT_...
1、在lichee中初始化RGB屏幕:KD027QVTPD022 W:\liuxing_csdn_tinav2.1\lichee\linux-3.4\drivers\video\sunxi\lcd\panels\default_panel.c static void LCD_panel_init(u32 sel) { u32 i; //printk("raoyiming ...
1、关闭“设置”中的“蓝牙”选项: R:\wyb\ap6181_sina33m_sc3817r\android\device\softwinner\astar-d7\overlay\frameworks\base\core\res\res\values\config.xml (干掉这里:) <!-- List of regexpressions ...
做嵌入式开发的朋友试试 调试内核很方便 QEMU emulator version 0.13.0, Copyright (c) 2003-2008 Fabrice Bellard usage: qemu [options] [disk_image] 'disk_image' is a raw hard disk image for IDE hard disk...
meta name="viewport" content="initial-scale=1.0,width=device-width,user-scalable=0,maximum-scale=1.0"/> scale scale 是屏幕拉伸比。也就是视口上的 initial-scale , maximum-sacle 等属性。 基准 以前是 ...
make your life easier and your interfaces more consistent, and they add resolution-independent placement for free. You get all this, regardless of device geometry, orientation, and window size. Auto ...
-synchronize synchronize image to storage device -taint declare the image as modified -texture filename name of texture to tile onto the image background -tile-offset geometry tile offset -...
-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]] [,mux=on|off] -chardev file,id=id,path=path[,mux=on|off] -chardev pipe,id=id,path=path[,mux=on|off] -chardev console,id=id...
DEVICE_PACKAGE_OVERLAYS := device/softwinner/astar-y3/overlay PRODUCT_CHARACTERISTICS := tablet # Overrides PRODUCT_AAPT_CONFIG := xlarge hdpi xhdpi large PRODUCT_AAPT_PREF_CONFIG := xhdpi PRODUCT_...
system/ device driver that prevents control being returned to the BurnInTest for that test. This was added for specialized serial port hardware that could lockup after several hours of testing. ...
17. Generating high precision analog voltage using an LTC2645 device 18. Processing analog signals 19. Measuring analog signals with the MCP3201 A/D converter 20. Using low-pass filters in data ...
upsearch until a device scope is found before executing _ADR. This allows PCI_Config operation regions to be declared locally within control methods underneath PCI device objects. Fixed a problem ...
Device Model Description=IEC 61966-2.1 Default RGB colour space - sRGB Viewing Conditions Description=Reference Viewing Condition in IEC61966-2.1 Viewing Conditions=view (0x76696577): 36 bytes ...