Home > Enterprise >  Adding photo background via VS Code
Adding photo background via VS Code

Time:12-03

May I ask on how to add photo background on my website using VS Code?

I tried checking in yt but its not background, it just add up to my website as photo alone.

CodePudding user response:

In css:- background-imge:url("");

i think this maybe helpful for everyone.

CodePudding user response:

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

  • Related