css - 在手機上背景顯示的問題。
問題描述
背景設置高度100%,在彈出軟鍵盤后背景會上縮,,,有什么辦法解決嗎
html{height: 100%;}body{ font: '微軟雅黑'; background: url(image/bj.jpg) no-repeat center center; background-size: 100% 100%; height: 100%;}
問題解答
回答1:取消html,body的高度100%,背景使用圖片絕對定位,寬度百分百,然后登陸框 同樣 絕對定位居中。
回答2:寬度100高度自動試試
回答3:在線等,,,急
回答4:用你的代碼簡單測試了下,貌似沒有問題,彈出的鍵盤雖然會使屏幕可用高度變小,但是感覺就像是蓋在屏幕上的,直到你滾動頁面到最底部,才看到鍵盤是占據了屏幕空間的。 懷疑是頁面其他樣式引起的。 (在iPad 和 Windows Phone 上測試過)
<!DOCTYPE html><html> <head><title>測試</title><style> html{height: 100%; } body{background: url(’test.jpg’) no-repeat center center;background-size: 100% 100%;height: 100%; }</style> </head> <body><h1>測試</h1><input type='text' name='name' value='' /> </body></html>
相關文章:
1. html - 爬蟲時出現“DNS lookup failed”,打開網頁卻沒問題,這是什么情況?2. 求救一下,用新版的phpstudy,數據庫過段時間會消失是什么情況?3. mac里的docker如何命令行開啟呢?4. boot2docker無法啟動5. 這是什么情況???6. mysql - ubuntu開啟3306端口失敗,有什么辦法可以解決?7. css - z-index 和 translateZ(0)的疑問8. javascript - 微信公眾號web頁面開發調試9. 在微信瀏覽器中使用iframe,android會出現空白,ios會跳轉,怎么阻止這些?10. node.js - vue怎么部署到網站里
