Site logo

Archived topic

Center image in sidebar?

7 replies · Started by Carol on October 7, 2019

Viewing posts 1–8 of 8

Is there a way to center an individual image in the sidebar with settings in the theme?

Thank you.

X80Ws+031v45

Hi there,

CSS is required. I assume you are talking about the first image widget?

Try this CSS:

.sidebar .widget_media_image {
    text-align: center;
}

Let me know if this helps :)

Yes, the book image.

What does this code do - center just first occurance in sidebar or center all the sidebar or what?

Thank you so much!

This CSS?

@media (min-width: 769px) {
    .post-image-aligned-left .post-image img {
        max-width: 405px;
    }
}

That's setting the max-width of featured image to 405px on desktop view - irrelevent to the sidebar.

No, the one you just gave me now:

.sidebar .widget_media_image {
text-align: center;
}

Does this just affect one image (first widget in sidebar), or all of them or what?

Thank you.

It will center all image widgets added in sidebar. You currently only have one image widget.

Right - I guess that's okay for now. If I come to a situation where I want one to left or right align, will come back. :-)

Sounds good :)

This archived topic is closed to new replies.