how to insert an image by css?

Asked

Viewed 2,375 times

2

inserir a descrição da imagem aqui

I want to insert in my style.css file an image that is inside the images folder that is inside my Assets folder. what path I have to describe to reach this directory?

2 answers

0

Cannot insert images by css The css only serves to design the site! To insert the image you have to html, this is an example of how to put

<img src="img_girl.jpg" alt="Girl in a jacket">

to access the folder is to enter the example path: <img src="../data/imagens/picture.jpg ...

0


Stephan basically you have to turn a folder up using the ../ and falling at the root of pasta assets then you have to enter the folder /images, then browse your image inside the folder /nome-imagem.jpg

Then your way would be like this: url(../imagens/nome-imagem.jpg)

Read this Answer that will help you a lot to better understand how this "navigation" works by the pasture of the project Difference between './', '.. /' and '/'

  • thank you very much, it worked right rs!!!

  • @Stephanviana, I’m so glad it worked out! If my answer helped you in any way consider marking it as Accept, in this icon below the arrows on the left side of my answer :) so the site does not get open questions pending without response accepted.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.