私は、デバイス、ブラウザー、ウィンドウのサイズに関係なく、完全に適合する背景として画像を作成する必要があるプロジェクトに取り組んでいます。ネットで何時間も研究した後、これは私が得た最高のCSS設定です:
background: url(datas/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
それは、すべてのブラウザーとデバイスで正常に機能し、画像は背景に完全に適合します。ただし、Android システムでは、画像が垂直方向に収まらず、ご覧のとおり上部に移動しています。
ここに。
私もこれを試しました
background: url(datas/bg.jpg) no-repeat center center fixed;
-webkit-background-size: 100%;
-moz-background-size: 100%;
-o-background-size: 100%;
background-size: 100%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
しかし、まだ機能していません
助けていただければ幸いです、ありがとう。