I have the following question:
I have the following image in a PSD file.
I'm using Bootstrap to develop the system, but I needed this image to be made with CSS and to be responsive.
Any suggestions?
Thank you!
img{
width: 100%;
max-width: 300px; /* coloque aqui o tamanho real da imagem em px */
}
So the image will fit your box, but your box should also be 100%.
Example:
<div style="width: 100%">
<img style="width: 100%; max-width: 300px;" src="imagem.png">
</div>
I did CSS Inline to show you, but it could be the other way.
What you can do is define the image with these properties.
img{
width:100%;
height:auto;
}
This will take up the entire width of the element that contains it. In order to be able to limit this size of image when in bigger or smaller screens you can use grid view. Take a look at: link
As already mentioned, you can also use media queries