WordPress.org

Forums

Customizr
[resolved] Sidebar padding (4 posts)

  1. chappie
    Member
    Posted 1 year ago #

    Having given my sidebar a background color, I needed to move all titles, icons, widget text and any other content away from the left and right edges of the container. The code I used did the job perfectly - but it also changed the margins in my FP and footer widget areas, causing havoc:

    /*  Widget area padding */
    .widget-area {
    margin-left: 5%;
    margin-right: 5%;
    }

    Could anyone please tell me how I can exempt the other parts of my page from this code? I tried using padding-left/right instead but it had no effect on my sidebar.

    Thank you.

  2. chappie
    Member
    Posted 1 year ago #

    I've found the :not selector which looks handy. Is that is the right way to go about this -- although I might have trouble if the non-sidebar elements on my page have variable margin settings since the :not syntax requires me to apply my code in reverse, ie apply a value to all other elements which aren't .widget-area so that I can apply a different value to .widget-area. Hopefully, it doesn't have to be this complicated.

  3. rdellconsulting
    Member
    Posted 1 year ago #

    Did you try using .left & .right?

    .left .widget-area, .right .widget-area {...}

    Then margin/padding should work

  4. chappie
    Member
    Posted 1 year ago #

    Yay! Thank you, Dave.

    Now I'm annoyed with myself for not engaging logical brain last night. But it *was* late.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic