how do i make an image responsive??

WordPress theme dedicated to start-up websites with amazing CSS3 animated icons, price tables and parallax effect background.
GK User
Fri Feb 20, 2015 2:27 pm
How do I make an element in my site responsive so that it resizes with the browser window size. Could it be done to a table or image?? Let's say I add an image to a text widget and would like to make it size up and down according to the browser window. Is there code for that? Thanks.
User avatar
Gold Boarder

GK User
Fri Feb 20, 2015 7:12 pm
Hi,

The basic method for that is adding to the image css rule: max-width: 100%
Then When you are resizing browser, the image will be adjusted to the container.

so add image i.e. <img src="path.." class="my-image" />
Then in css code:
Code: Select all
.my-image {
height: auto;
max-width: 100%;
}
User avatar
Moderator


cron