简体   繁体   English

媒体屏幕,最小宽度:965像素,最大宽度:965像素

[英]media screen and min-width: 965px and max-width: 965px

@media screen and (min-width: 965px){
   //style here
}
@media screen and (max-width: 965px){
   //some other style
}

every thing works fine in less than or more than 965px but when the screen on 965px bugs appear 小于或大于965px时,一切正常,但是出现965px的屏幕错误时,

is there is any way to fix that 有什么办法可以解决

Switch the order and give yourself 1px of leeway between the 2. 切换顺序,让自己在2之间留出1px的回旋余地。

@media screen and (max-width: 964px){
   //some style
}   


@media screen and (min-width: 965px){
   //style here
}

This way, there is no overlap. 这样,就不会有重叠。

Note: It is not recommended to use bot min and max width in screen size queries. 注意:建议不要在屏幕尺寸查询中使用最小和最大宽度。 If you just use min-width, and list them from smallest to largest, the one below will override the one above it. 如果仅使用最小宽度,并从最小到最大列出它们,则下面的一个将覆盖上面的一个。

Just change the second one to 只需将第二个更改为

@media screen and (max-width: 964px){

that way the y will be kept seperated and won't interfere with each other. 这样,y将保持分离,并且不会互相干扰。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 css function @media 屏幕和(最大宽度:768px)在 jquery 中的任何倡议? - Any iniative to the css function @media screen and (max-width: 768px) in jquery? 如何让@media(max-width 425px) 单独工作,而不是跟随@media(max-width 768px) - How to get @media(max-width 425px) to work alone, and not follow @media(max-width 768px) jQuery min-width vs width:如何删除px? - jQuery min-width vs width: How to remove px? 如何在matchMedia查询中组合最大宽度,最小宽度? - How to combine max-width, min-width in matchMedia query? 如何删除javascript src,如果@media(min-width:xxx px){ - How to remove javascript src's if @media (min-width:xxx px) { 仅当最小宽度为800px时才执行Javascript - Executing Javascript only if min-width is 800px 在@media(最大宽度:786px)上的IE 8,9中显示css none无法正常工作{} - Display css none is not working in IE 8,9 on @media (max-width:786px){} 如何设置画布元素的最小宽度、最大宽度、最小高度、最大高度 - how to set min-width, max-width, min-height, max-height for canvas element 画布响应式媒体屏幕最小宽度 - FabricJS - Canvas responsive media screen min-width - FabricJS 将两个 div 居中,最大宽度:1224px,在 100% 宽度的容器内 - Center two divs, with a max-width: 1224px, within a 100% width container
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM