簡體   English   中英

在移動瀏覽器中,頁腳圖像不會重復,但是背景圖像會重復並且很好

[英]in mobile browsers, the footer image does not repeat, but the background image does and is fine

我的網頁在桌面瀏覽器上運行良好,但是在iPhone上打開該網頁時,背景圖像會重復,但頁腳圖像不會重復。 它們具有幾乎相同的CSS代碼,這可能是什么問題?

這是我的身體的CSS代碼

body.login {
   margin:0;
   padding:0;
   position:relative; 
   background: #161616 url(../img/login-page-bg_01.png) left top repeat-x;
   font-family: roboto,"Helvetica Neue",helvetica,arial,sans-serif; 
   font-size:12px;
   line-height: 1.7em;
   height:750px;}

這是頁腳的CSS代碼

.login div.footer{
margin:0;
padding:0;
background:url(../img/login-page-bg-footer.png) left top repeat-x; 
position:relative;
bottom:0;
left:0;
width:100%;
height: 117px;
z-index:5;
    }

問題是主體bg圖像重復,但頁腳圖像僅重復一次。

沒有看到您所有的代碼,這些可能是問題:

  • 移動Safari不能很好地呈現非常大的圖像(尺寸,而不是文件大小)。
  • width: 100%僅在其父級具有固定寬度時才有意義。
  • 嘗試移去leftbottomposition 在這種情況下,它們是無用的。

要查看元素本身是否足夠大,可以添加背景色:

background: red url(../img/login-page-bg-footer.png) left top repeat-x; 

我為此喜歡“紅色”。 紅色是大還是小?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM