简体   繁体   English

如何在 CSS 中更改背景图像

[英]How to change background-image in CSS

I'm working on html&css and i have problem, i write background change code in css and background is not changing.我正在处理 html&css 并且遇到了问题,我在 css 中编写了背景更改代码并且背景没有更改。 Css: css:

 * { margin: 0; padding: 0; } body { min-height: 100vh; background-image: url('http://lorempixel.com/400/200/'); }

 * { margin: 0; padding: 0; } body { min-height: 100vh; background-image: url('http://lorempixel.com/400/200/'); background-size: cover; }

You haven't described the problem in detail.你没有详细描述问题。 Use this code and also link the CSS and HTML file properly by copying the path name of CSS file in your HTML file.使用此代码并通过在 HTML 文件中复制 CSS 文件的路径名来正确链接 CSS 和 HTML 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM