Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 从纵向移动到横向移动时需要刷新页面_Css_Mobile_Page Refresh_Landscape Portrait - Fatal编程技术网

Css 从纵向移动到横向移动时需要刷新页面

Css 从纵向移动到横向移动时需要刷新页面,css,mobile,page-refresh,landscape-portrait,Css,Mobile,Page Refresh,Landscape Portrait,我有一个网站,当它出现在一个小的智能手机(肖像)的标志是太大了,我想交换一个较小的图像 我可以做到这一点,没有问题,感觉非常聪明,但当投注者持有手机画面时,它会返回到大图像,我对此感到高兴,但当投注者持有手机肖像时,更大的图像仍然存在,直到页面刷新 我能做些什么来拥有它,这样投注者在将手机从横向转到纵向后就不需要刷新页面了 我在下面附上我当前的代码片段。它来自一个.css页面。请注意,我还尝试将此代码段添加到.css页面的前几行代码中,但没有产生任何影响。图像替换仅为10kb左右 /*+-+-+

我有一个网站,当它出现在一个小的智能手机(肖像)的标志是太大了,我想交换一个较小的图像

我可以做到这一点,没有问题,感觉非常聪明,但当投注者持有手机画面时,它会返回到大图像,我对此感到高兴,但当投注者持有手机肖像时,更大的图像仍然存在,直到页面刷新

我能做些什么来拥有它,这样投注者在将手机从横向转到纵向后就不需要刷新页面了

我在下面附上我当前的代码片段。它来自一个.css页面。请注意,我还尝试将此代码段添加到.css页面的前几行代码中,但没有产生任何影响。图像替换仅为10kb左右

/*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*/

/* Samsung Galaxy S2 (portrait) ----------- */
@media only screen and (max-device-width: 320px) and (orientation :     portrait) {

.phonenum {
display: none; 
}
.two-column-column1 .hide-logo {
display: none !important;
}
.two-column-column1 {
width:274px; /*width of my new small image image*/
height:74px; /*height of my new small image image*/
background: url(images/londonfabriccompany274-74.png) no-repeat;
margin:0; /* I didn't want no margin */
padding:0; /* I didn't want padding either */
}
.inner-one-columns-wrapper {
margin-top: 6px;
}
}

/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- */
谢谢你的意见,干杯


查看更多Yea Baby

您是否尝试过在媒体查询中添加横向参数,并围绕该媒体查询设置相同的图像要求

/*三星Galaxy S2(纵向)----*/

@仅介质屏幕和(最大设备宽度:320px)和(方向:纵向){

/**你的参数在这里**/ }

然后:

@仅介质屏幕和(最小设备宽度:320px)和(最大设备高度:640px)以及(方向:横向){

/**你的参数在这里**/


}

我尝试过@media only screen and(最小设备宽度:320px)和(最大设备高度:640px)和(方向:横向){但都不起作用。请注意,我使用的是S2,还尝试过atmedia only screen and(设备宽度:320px)和(设备高度:533px)和(-webkit设备像素比:1.5)和(方向:横向)但是那没有用。很抱歉之前没有回复,但我正试图解决如何直接回复你的问题,但无法回答。