Desarrollo Web

Add image in CSS with background image

If we are <a href="https://www.empresadeserviciosweb.com/servicios/disenando/”>designing with css and we want to add a background image, we will work with <a href="https://www.empresadeserviciosweb.com/post/diseno-de-paginas-web-profesionales-para-imagen-corporativa/” title=”Did you know that having a professional web page can completely change your business image? 😎💼”>css background image. <a href="https://www.empresadeserviciosweb.com/post/como-edit-una-pagina-web-en-wordpress/”>How to edit a page in WordPress .

I recommend you read this article which is interesting: <a href="https://www.empresadeserviciosweb.com/que-es-canonicalizacion-de-urls-y-tag-canonica/” title=”What is Canonicalization of URLs and canonical tag” class=”internal-recommendation” target=”_self” rel=”noopener”>What is Canonicalization of URLs and canonical tag.

To set a background image with this declaration that we have mentioned before background-image, the best thing would be to link it from a url that we have on our server or on some site even if it is external.

Keep in mind that if we set the image from an external server, it should not be protected by .htaccess.

css background image

css background image command

The command itself would be as I write below:

background-image: url(https://www.xxxxxxxxxxxxx.com/images/nombre-de-la-imagen.jpg);

Where it says www.xxxxxxxxxxxx.com you should put the url of the domain where the image you want to link is hosted; if it is your own domain, write it there.

With this you will now have the background image available, then you will have to make the relevant adjustments to give it the appropriate size and the positions where you want it to be displayed.

If you have any kind of doubt or need help, you can write a comment at the bottom of this post.

(adsbygoogle = window.adsbygoogle || []).push({});