CSS   发布时间:2022-04-17  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了css3 – 什么是媒体查询的最佳宽度范围大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
有人可以让我知道响应式设计中检测媒体查询的最佳宽度范围是多少?

我想在4个媒体查询中覆盖所有台式机/笔记本电脑显示器(有一个方向),但我不知道是否可能,例如:小型显示器,中型显示器,大型和超大型显示器.

例如在这段代码中

/* Desktops and laPTOPs ----------- */
 @media only screen and (min-width : 1224pX) {}

/* Large screens ----------- */
 @media only screen and (min-width : 1824pX) {}

我想我们仍然需要将台式机和笔记本电脑的媒体设置为三个子媒体(如13“至14”笔记本电脑),中等(如15至17)和大(超过22#),我知道浏览器分辨率不同比屏幕分辨率,但是我们说我们在所有格式的全屏模式下都有浏览器.

谢谢你的帮助

解决方法

尝试这个与视网膜显示
/* smartphones (porTrait and landscapE) ----------- */
@media only screen 
and (min-device-width : 320pX) 
and (max-device-width : 480pX) {
/* Styles */
}

/* smartphones (landscapE) ----------- */
@media only screen 
and (min-width : 321pX) {
/* Styles */
}

/* smartphones (porTrait) ----------- */
@media only screen 
and (max-width : 320pX) {
/* Styles */
}

/* iPads (porTrait and landscapE) ----------- */
@media only screen 
and (min-device-width : 768pX) 
and (max-device-width : 1024pX) {
/* Styles */
}

/* iPads (landscapE) ----------- */
@media only screen 
and (min-device-width : 768pX) 
and (max-device-width : 1024pX) 
and (orientation : landscapE) {
/* Styles */
}

/* iPads (porTrait) ----------- */
@media only screen 
and (min-device-width : 768pX) 
and (max-device-width : 1024pX) 
and (orientation : porTrait) {
/* Styles */
}

/* Desktops and laPTOPs ----------- */
@media only screen 
and (min-width : 1224pX) {
/* Styles */
}

/* Large screens ----------- */
@media only screen 
and (min-width : 1824pX) {
/* Styles */
}

/* iPhone 4 ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),only screen and (min-device-pixel-ratio : 1.5) {
/* Styles */
}

更新

/* smartphones (porTrait and landscapE) ----------- */
@media only screen and (min-device-width: 320pX) and (max-device-width: 480pX) {
  /* Styles */
}

/* smartphones (landscapE) ----------- */
@media only screen and (min-width: 321pX) {
  /* Styles */
}

/* smartphones (porTrait) ----------- */
@media only screen and (max-width: 320pX) {
  /* Styles */
}

/* iPads (porTrait and landscapE) ----------- */
@media only screen and (min-device-width: 768pX) and (max-device-width: 1024pX) {
  /* Styles */
}

/* iPads (landscapE) ----------- */
@media only screen and (min-device-width: 768pX) and (max-device-width: 1024pX) and (orientation: landscapE) {
  /* Styles */
}

/* iPads (porTrait) ----------- */
@media only screen and (min-device-width: 768pX) and (max-device-width: 1024pX) and (orientation: porTrait) {
  /* Styles */
}

/* iPad 3 (landscapE) ----------- */
@media only screen and (min-device-width: 768pX) and (max-device-width: 1024pX) and (orientation: landscapE) and (-webkit-min-device-pixel-ratio: 2) {
  /* Styles */
}

/* iPad 3 (porTrait) ----------- */
@media only screen and (min-device-width: 768pX) and (max-device-width: 1024pX) and (orientation: porTrait) and (-webkit-min-device-pixel-ratio: 2) {
  /* Styles */
}

/* Desktops and laPTOPs ----------- */
@media only screen and (min-width: 1224pX) {
  /* Styles */
}

/* Large screens ----------- */
@media only screen and (min-width: 1824pX) {
  /* Styles */
}

/* iPhone 4 (landscapE) ----------- */
@media only screen and (min-device-width: 320pX) and (max-device-width: 480pX) and (orientation: landscapE) and (-webkit-min-device-pixel-ratio: 2) {
  /* Styles */
}

/* iPhone 4 (porTrait) ----------- */
@media only screen and (min-device-width: 320pX) and (max-device-width: 480pX) and (orientation: porTrait) and (-webkit-min-device-pixel-ratio: 2) {
  /* Styles */
}

/* iPhone 5 (landscapE) ----------- */
@media only screen and (min-device-width: 320pX) and (max-device-height: 568pX) and (orientation: landscapE) and (-webkit-device-pixel-ratio: 2) {
  /* Styles */
}

/* iPhone 5 (porTrait) ----------- */
@media only screen and (min-device-width: 320pX) and (max-device-height: 568pX) and (orientation: porTrait) and (-webkit-device-pixel-ratio: 2) {
  /* Styles */
}

/* iPhone 6 (landscapE) ----------- */
@media only screen and (min-device-width: 375pX) and (max-device-height: 667pX) and (orientation: landscapE) and (-webkit-device-pixel-ratio: 2) {
  /* Styles */
}

/* iPhone 6 (porTrait) ----------- */
@media only screen and (min-device-width: 375pX) and (max-device-height: 667pX) and (orientation: porTrait) and (-webkit-device-pixel-ratio: 2) {
  /* Styles */
}

/* iPhone 6+ (landscapE) ----------- */
@media only screen and (min-device-width: 414pX) and (max-device-height: 736pX) and (orientation: landscapE) and (-webkit-device-pixel-ratio: 2) {
  /* Styles */
}

/* iPhone 6+ (porTrait) ----------- */
@media only screen and (min-device-width: 414pX) and (max-device-height: 736pX) and (orientation: porTrait) and (-webkit-device-pixel-ratio: 2) {
  /* Styles */
}

/* Samsung Galaxy S3 (landscapE) ----------- */
@media only screen and (min-device-width: 320pX) and (max-device-height: 640pX) and (orientation: landscapE) and (-webkit-device-pixel-ratio: 2) {
  /* Styles */
}

/* Samsung Galaxy S3 (porTrait) ----------- */
@media only screen and (min-device-width: 320pX) and (max-device-height: 640pX) and (orientation: porTrait) and (-webkit-device-pixel-ratio: 2) {
  /* Styles */
}

/* Samsung Galaxy S4 (landscapE) ----------- */
@media only screen and (min-device-width: 320pX) and (max-device-height: 640pX) and (orientation: landscapE) and (-webkit-device-pixel-ratio: 3) {
  /* Styles */
}

/* Samsung Galaxy S4 (porTrait) ----------- */
@media only screen and (min-device-width: 320pX) and (max-device-height: 640pX) and (orientation: porTrait) and (-webkit-device-pixel-ratio: 3) {
  /* Styles */
}

/* Samsung Galaxy S5 (landscapE) ----------- */
@media only screen and (min-device-width: 360pX) and (max-device-height: 640pX) and (orientation: landscapE) and (-webkit-device-pixel-ratio: 3) {
  /* Styles */
}

/* Samsung Galaxy S5 (porTrait) ----------- */
@media only screen and (min-device-width: 360pX) and (max-device-height: 640pX) and (orientation: porTrait) and (-webkit-device-pixel-ratio: 3) {
  /* Styles */
}

大佬总结

以上是大佬教程为你收集整理的css3 – 什么是媒体查询的最佳宽度范围全部内容,希望文章能够帮你解决css3 – 什么是媒体查询的最佳宽度范围所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。