• i have youtube and nextgen sidebar widgets
    both are aligned left, i need them to be centered, how?
    and i dont mean text above widgets but objects themselves, look!
    https://dl.dropbox.com/u/13061390/example.png

    nextgen and youtube are on the left inside black square, i need them to be in the center…
    i use twentyeleven child theme

Viewing 5 replies - 1 through 5 (of 5 total)
  • That’s a Css Problem…
    What about posting the url or the code (style.css and sidebar.php)??

    Thread Starter lebowzki

    (@lebowzki)

    this is offline page
    yes, i would like to know what i need to add/change to my style.css
    or sidebar.php

    Until you don’t post the code, i am not able to solve the problem definitely.. So try to add the tag <center> and </center> where there is the code that displays the image in sidebar.php…
    Or try a better solution by editing the css in the class used by the image: add text-align:centre;

    The best way to align elements is to use a fixed width (which must be less than the enclosing element) and then set the left and right margins to “auto”.

    So if your widget has id=widget1 and is 300px wide, your CSS would be:

    #widget1 {
    margin: 0 auto;
    }

    The zero in the above (for top and bottom) can be whatever space you want.

    See this for more: https://www.w3schools.com/css/css_align.asp

    That rarely works in my experience…if it’s a text widget add margin-left or margin-right as an inline style – depending on what side of the page the sidebar is on. And yes, without a live site, we are only guessing.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘how to center a widgets in sidebar?’ is closed to new replies.