我正在制作一个具有旋转背景图像的网页。在本地主机上开发,我安排了一些东西,让图像中的人物定位在我想要的位置。但是,当我推送到服务器并在不同浏览器中打开网页时,有些人不在屏幕上,并且结果因浏览器而异。CSS:本地主机和服务器之间的对齐更改
这是我使用
.animate-this .img1,
.animate-this .img3 {
clear: left;
display: block;
width: 100%;
height: 1210px;
margin-left: auto;
margin-right: auto;
}
.animate-this .img2 {
clear: left;
display: block;
width: 1620px;
height: 1210px;
margin-left: auto;
margin-right: auto;
background-color: #2b292b;
background-repeat: no-repeat;
}
.animate-this .img4 {
clear: left;
display: block;
width: 1522px;
height: 1210px;
background-color: #2b292b;
background-repeat: no-repeat;
}
请附上您的html。 – Narendra
在您的服务器CSS和您的本地CSS上运行差异。另请检查您部署的背景图像是否与本地版本相同。这很可能是您的部署方法中的一些错误。 – Duopixel
@Rain你知道Ruby on Rails吗?很难显示HTML而没有发布来自不同文件,并且问题在于背景图像正在随着javascript而改变。但是,你可以看看服务器上的应用程序在sugarpova.herokuapp.com – Leahcim