Change image size for mobile
-
I have an image that looks fine on preview of desktop and tablet, but it gets cut off on mobile view. In chrome inspector, I see the following:
.wp-block-image .components-resizable-box__container img { display: block; width: inherit; height: inherit; }
and if I change the width and height to 50% it fits fine.
To test things, I went to simple CSS and added the following:
.wp-block-image .components-resizable-box__container img { display: block; width: 50% !important; height: 50% !important; }
And nothing changes.
So the first question is what am I doing wrong with simple CSS.
After getting it to work, I should be able to use:
@media (max-width: 768px) {
.wp-block-image .components-resizable-box__container img {
display: block;
width: 50% !important;
height: 50% !important;
}`
}`except it would affect ALL images in mobile, and I just want this one to change. So how can I change just the one image.
Thanks,
Doc
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Change image size for mobile’ is closed to new replies.