Change img in responsive wordpress

0

I'm having problems with imagenes that occupy all div 1080px , to pass them to responsive I want them to occupy longer than wide obviously cutting the photo by the sides but I can not do it, how much stretching the photo and that is pretty bad, some solution?

wordpress html

and the father's div has a display: block

As you can see it's wordpress, they told me over the weekend that it could be achieved by putting the image as a background

    
asked by Carlos 24.08.2018 в 14:39
source

1 answer

1

If you want the image not to rescale you, as I understand what is happening to you, you have the option to use the CSS property "overflow: hidden".

HTML

<div>
  <img src="url_de_tu_imagen" />
</div> 

CSS

div {
  width: 100%;
  overflow: hidden;
}

img {
  width: 500px
}

This code, what I would do would be that by showing the image on a smaller device, having it with a fixed size and its container with the mentioned property, you would avoid that rescaling and the remainder (that without the overflow: hidden it would come out of his box) would disappear.

I do not know if this is what you were looking for. If that were not the case, I would appreciate it if you could provide more information.

Greetings ^^

    
answered by 24.08.2018 в 15:11