css 通过VS代码添加照片背景

7gyucuyw  于 2022-12-05  发布在  其他
关注(0)|答案(2)|浏览(134)

我可以问一下如何使用VS代码在我的网站上添加照片背景吗?
我试着检查在yt,但它不是背景,它只是加起来,我的网站作为照片单独。

cuxqih21

cuxqih211#

在css:- background-imge:url(“”)中,您可以使用以下命令:
我想这可能对大家都有帮助。

dfuffjeb

dfuffjeb2#

using css background-image: url("url") // it is the best practice

but you will have to also set some addtional css properties like
.div{
background-image: url("../images/demo.png");
background-repeat: no-repeat;
background-size: 300px 400px;
background-origin: content-box;
background-position: center;
}

try these the url can be a link to some hosted image file or it can be a local image as showed in the example try these
Accept the answer if this helps

相关问题