GIF 背景图片未出现在我的页面上
GIF Background Image not appearing on my page
我想在我的网页上使用 GIF 文件作为背景图片,但是当我在 CSS 中设置它的样式时它不起作用。
CSS
Body{
background-image: url("1554323659436.gif");
background-repeat: no-repeat;
background-size: 50% 50%;
content:white;
width: auto;
}
我已确保 GIF 名称准确无误,但该图片未出现在页面背景中。有人可以帮忙吗?
希望这个回答对您有所帮助。根据我的经验,当文件夹结构未正确定义时,gif 图像或图像通常无法显示。请检查在 html 背景
中附加 gif 或任何图像类型的标准格式
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 */
}
请注意,除第一个属性外,其他所有属性都可以是可选的。祝你好运!
我想在我的网页上使用 GIF 文件作为背景图片,但是当我在 CSS 中设置它的样式时它不起作用。
CSS
Body{
background-image: url("1554323659436.gif");
background-repeat: no-repeat;
background-size: 50% 50%;
content:white;
width: auto;
}
我已确保 GIF 名称准确无误,但该图片未出现在页面背景中。有人可以帮忙吗?
希望这个回答对您有所帮助。根据我的经验,当文件夹结构未正确定义时,gif 图像或图像通常无法显示。请检查在 html 背景
中附加 gif 或任何图像类型的标准格式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 */
}
请注意,除第一个属性外,其他所有属性都可以是可选的。祝你好运!