I'm trying to show an image inside a div to use it as a background and display infromation on the background.
<div style="background-image: url('https://www.yucatanalamano.com/wp-content/uploads/2017/05/cdn.expansion.mx_-97.jpg')">
</div>
I'm trying to show an image inside a div to use it as a background and display infromation on the background.
<div style="background-image: url('https://www.yucatanalamano.com/wp-content/uploads/2017/05/cdn.expansion.mx_-97.jpg')">
</div>
The way to put the image is correct, should not give you any error. The problem is in the div, you have not specified size and, although you draw it with the background image, it does not show it because its width and length is 0. Try to size it.
<div style="background-image: url('https://www.yucatanalamano.com/wp-content/uploads/2017/05/cdn.expansion.mx_-97.jpg'); width: 200px; height: 200px">
</div>
With that it should look perfectly.
As a curious fact: It also works if you do not put quotation marks in the url, I think it is not a good practice but it has never given me problems and it may be good if in a longer code you have problems with the quotes.
background-image: url(URLIMAGENSINCOMILLAS)
The quotes are well used ... all you have to do is add content to your div so that the image is reflected
<div style="background-image: url('https://www.yucatanalamano.com/wp-content/uploads/2017/05/cdn.expansion.mx_-97.jpg');color:white">
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
<br>CONTENIDO
</div>
Hello @ARR the "image" to which you refer is actually a redirection to the page of which I suppose you try to get the image. I imagine you looked for it in Google Images and you gave right click in copy link. I suggest you better click on "View image" and then, copeas the url of the image of the address bar of your browser. Preferably note that the url ends in .png, .jpg, .jpeg, .svg, .gif, etc. Greetings!