Search code examples
htmlgalleria

centering a galleria (Javascript/Jquery) issue


Currently i got this piece of code when it comes to centering

#galleria{
width: 700px;
height: 400px;
background-color: #000;

However, i wanted the galleria to be shown in the middle, it just shows at the right corner, i use jquery, and the galleria from www.galleria.io however i just can't center the galleria, is there any way?


Solution

  • I don't know why it would be in the right corner with out floating it...

    Anyways, you should add margin: 0 auto; to the css like:

    #galleria{
       width: 700px;
       height: 400px;
       background-color: #000;
       margin: 0 auto;
    }
    

    Make sure that it's container has a width set as well.