Site logo

Archived topic

Full width images in all pages/posts on mobile

3 replies · Started by Fai on June 26, 2021

Viewing posts 1–4 of 4

Hi guys,

I've been looking through the forum but did not find a solution.

I'm trying to make images on my pages and posts display from edge to edge on mobile.

I've used the css code below. It worked for margin-left but not for margin-right.

@media (max-width:768px){
	 img {
		margin-left: -10px;
		margin-right: -10px;
}

Thanks!

Hi there,

try this:

@media (max-width:768px) {
    .entry-content img {
        margin-left: -10px;
        max-width: 100vw !important;
    }
}

I have added the entry-content class so it only affects images inside your post content.

worked perfectly. thank you for the quick response!

Glad to be of help

This archived topic is closed to new replies.