Archived topic
Centralize Sidebar Widget
5 replies · Started by Bobby on November 15, 2021
Please advise how to centralize sidebar Widgets
Hi Bobby,
I'm not sure I understand the context of this. Can you explain a bit more?
Perhaps you to center align the widget contents of the sidebar? Let us know.
Yes it's for content, Tried with the content but its not working. Like to see theme has any options
something like this
https://generatepress.com/forums/topic/center-alignment-for-footer-widgets/ ?
Attached image link
Try this CSS:
.separate-containers .inside-right-sidebar, .separate-containers .inside-left-sidebar {
text-align: center;
}
That should center all the elements from GP.
The rest would be plugin content that you'd need to target separately.
Done can't see any difference. Attached a new image. The marked widget looks bad now. Text was left aligned before.
It's going to be tricky to center some parts, especially the ads if the parts themselves are almost as wide as the sidebar.
The parts specifically are the ads. They have a fixed width of 300px and it's being an issue for alignment when paddings are applied.
You can actually test this out by adding this CSS:
.widget-area .widget {
padding: 0px !important;
}
If you apply this, the sidebar items will align because the fixed size ads isn't being pushed but you'll lose spacing between elements.
You can try tweaking it by doing this:
.widget-area .widget {
padding: 40px 25px !important;
}
or by trying to remove the fixed ad size by making it 100% width of the container instead of having a fixed size.