Archived topic
Post image size on mobile
13 replies · Started by Kevin on March 20, 2018
I want it only on the mobile the images full appearance. 100% wide! No margins or padding.
The big problem is that if I try to change it the way I know. The text increases along with the image. I just want images to go beyond that blank on mobiles like adsense ads do.
An Image of how it is and how I want it:

You could do this:
@media(max-width: 768px) {
.post-image {
margin: -15px -25px 25px -25px !important;
}
}
However, it will only work if your images are wide enough. Right now they likely aren't, so they won't reach the sides.
I put this code but it did not change anything ... I cleared the cache and tried several times ... I do not think the article images have the post-image attribute when looking at the source code of the page.
Did you make sure the images are wide enough as Tom mentioned above?
750x350
750x350 |||| it looks like the code you sent me changed only the prominent images within the categories and home.
The images are set to 375px wide: https://www.screencast.com/t/uUWYAE0oz
Perhaps that's the width you have set in the Customizer?
If you go down small enough, you can see that it's working: https://www.screencast.com/t/dfT3aiBAO0
As I said, these images are miniature, I want the images inside the article to stay the way they... problem they do not have the post-image .css attribute.
They have only the img attribute, but if I do it goes with CSS going to bug everything images, and if I change the container it will take the margin of the texts beyond the image.
Summing up! I want the images inside the post to stay that way.
So you're trying to target the images inside the full post?
If so, you can replace .post-image with .featured-image.
but .featured-image does not reference only the featured image at the top of the article?
Yes, that class is only for the featured image.
If you're wanting to do this to all images within your posts, you would have to wrap them in a div with a class, then apply that CSS to the class.
Is not there a way to make all the images inside the post get wrapped up in a div like they did with video iframes? With a code in functions.php?
Maybe something like this?: https://wordpress.stackexchange.com/a/36014/90661