Webページの背景画像としてGIFファイルを使用したいのですが、CSSでスタイルを設定すると機能しません。
CSS
Body{
background-image: url("1554323659436.gif");
background-repeat: no-repeat;
background-size: 50% 50%;
content:white;
width: auto;
}
GIF名が正確であることを確認しましたが、画像がページの背景に表示されていません。誰かが助けることができますか?
この回答がお役に立てば幸いです。私の経験では、フォルダ構造が適切に定義されていないと、gif画像や画像は一般的に表示されません。gifまたはhtml背景の任意の画像タイプを添付するための標準形式を確認してください
body {
background-image: url("[path_to_image]/1554323659436.gif"); /* The image used */
background-color: #cccccc; /* Used if the image is unavailable */
height: 500px; /* You must set a specified height */
background-position: center; /* Center the image */
background-repeat: no-repeat; /* Do not repeat the image */
background-size: cover; /* Resize the background image to cover the entire container */
}
最初の属性を除いて、他のすべての属性はオプションである可能性があることに注意してください。がんばろう!
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加