gpt4 book ai didi

html - css 媒体横向和纵向

转载 作者:搜寻专家 更新时间:2023-10-31 21:46:33 24 4
gpt4 key购买 nike

为什么我在下面添加了 css 媒体,并且两种配置的 nexus 5 上的像素效果不一样。好像是三分之二。 (纵向 60px 的大小与横向 40px 的大小一样)。

我应该知道什么概念? (我真的很迷茫)

@media only screen and (max-device-width: 768px)and (orientation:portrait)

@media only screen 和 (max-device-width: 768px)and (orientation:landscape)

更新问题

https://jsfiddle.net/Lgvpszrt/2/

图片中的高度和文字大小不一样。

enter image description here

//----------------------------

在我将代码修复为 https://jsfiddle.net/Lgvpszrt/3/ 之后, 它正在工作。

但是我不知道这个概念。

最佳答案

这可能是因为像素密度不同。请查看 Mozila 的这篇文章,以更好地了解移动设备上的视口(viewport)和像素。

https://developer.mozilla.org/en/docs/Mozilla/Mobile/Viewport_meta_tag

http://www.quirksmode.org/blog/archives/2010/04/a_pixel_is_not.html

关于html - css 媒体横向和纵向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38341807/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com