Is it possible to target chrome by html or media query only

↘锁芯ラ 提交于 2019-12-10 14:34:10

问题


this is the media query:

<link rel="stylesheet" media="screen and (min-device-width: 1024px)" href="desktop.css"/> 

<link rel='stylesheet' media='screen and (min-width: 1023px) and (max-width: 1025px)' href='ipad.css' />

so that i get different style in size of 1024px but this worked on all browsers except chrome the new style appears in size of 1041px

is there any way to target chrome only to give it ipa style in different size


回答1:


The following can be used to target CSS for Chrome (and Safari, as both are WebKit based):

@media screen and (-webkit-min-device-pixel-ratio:0) {
   /* CSS rules */
}

See Question on webkit-min-device-pixel-ratio



来源:https://stackoverflow.com/questions/8897063/is-it-possible-to-target-chrome-by-html-or-media-query-only

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