-1
上の画面全体をカバーこれは私のコードです:背景画像を作るためにどのようにモバイル
body {
\t
\t margin: 0px; /* Background Image Margin will be 0 */
background-image: url('https://static.pexels.com/photos/17679/pexels-photo.jpg'); /* Background Image Linki */
background-repeat: no-repeat; /* Background Image Will not repeat */
background-attachment: fixed; /* Background Image will stay fixed */
background-size: cover; /* This will make background image width 100% and height 100% */
\t
\t
}
<h1>Hello</h1>
それは完全に正常に動作しています。ブラウザのサイズを変更したり、Google Chromeでf12>モバイルサイズを使用すると、正常に動作しています。
実際のモバイルデバイスで使用する場合、幅は100%、高さも100%です。つまり、携帯端末の写真は60%の高さしかカバーしていません。
<meta name="viewport" content="width=device-width, initial-scale=1">