0

Im trying to insert an image with css, the problem is that it works whit http images from the internet , but when i use my local images with the right path is not working.

btw I have the images in the same folder of the html file. also using right click copy path from visual code.

here is the css:

.cuerpo{
    background-image:url(""); 
    height: 100vh;
    background-size: bottom;
    display:flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

}
1
  • this is the path im using C:\Users\elari\OneDrive\Documents\CacheStudioOff\img\LampPostBannercache.jpg Commented Aug 30, 2020 at 16:48

2 Answers 2

0

If its on the same folder, try this solution.

.cuerpo{
    background-image:url("filename.extension"); 
    height: 100px;
    background-size: bottom;
    display:flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

So, you only write the filename.extension there.

Sign up to request clarification or add additional context in comments.

Comments

0

If you have your images in the same folder as the .html files, then you should specify only the image name. For example background-image: url('image.jpg')

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.