I can't add a file from my computer to use for my background on my website. Can only use URLs. How can I get the local file added?
CodePudding user response:
because you are setting width to 100%
instead use a px
or rem
value.100%
means 100% of its parent & i assume it doesn't have a parent.
div {
height: 320px;
width: 240px;
background: url(https://upload.wikimedia.org/wikipedia/commons/c/c9/-Insert_image_here-.svg);
background-position: center;
background-repeat: no-repeat;
background-size: contain;
}
<div></div>