I have a widget in my website's sidebar with an image. The website is responsive so that when resizing the browser and the sidebar is forced below the main content, the widget and image expands to fill the available space.
The image has an inline CSS width property: width: 100%
.
I want to change this to: max-width: 100%
I tried using: max-width: 100% !important
but the image is still expanding to the full width of the parent element even though the actual width of the image is smaller than the width of the parent element.
My understanding is that when the 2 properties come into conflict, themax-width:
property overrides the width:
property.