Title: Centering elements within container..
Last modified: August 22, 2016

---

# Centering elements within container..

 *  Resolved [MasterOmok](https://wordpress.org/support/users/masteromok/)
 * (@masteromok)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/centering-elements-within-container/)
 * I am working on a responsive website, and need the portfolio elements to be centered
   within the container. I already purchased the pro version so I could change the
   size of the elements to fit on my responsive versions, but I cannot get the elements
   to center. I am using the “Blocks Toggle Up/Down” option.
 * The container by default takes up 100% width, which is what I want, but the content
   inside is not centered. When my site is at it’s highest width there are two elements
   on the same line, but they are left aligned. For example I have six items, with‘
   |’ indicating the container boundaries:
 * |(item)(item)(space)|
    |(item)(item)(space)| |(item)(item)(space)|
 * I would like it to be centered like the following:
 * |(space)(item)(item)(space)|
    |(space)(item)(item)(space)| |(space)(item)(item)(
   space)|
 * This also comes into play when the site is at one of it’s smaller widths, and
   only one element per line is visible:
 * |(item)(space)|
    |(item)(space)| |(item)(space)| |(item)(space)| |(item)(space)
   | |(item)(space)|
 * When I would like that to look like:
 * |(space)(item)(space)|
    |(space)(item)(space)| |(space)(item)(space)| |(space)(
   item)(space)| |(space)(item)(space)| |(space)(item)(space)|
 * It appears that the div “element hugeitmicro-item” is the container for each 
   item, but it is absolute positioned at left 0px top 0px for each.. I’ve been 
   trying to toy with some of the CSS to move them around, but I just cannot seem
   to get it working. How can I accomplish centering the items?
 * [https://wordpress.org/plugins/portfolio-gallery/](https://wordpress.org/plugins/portfolio-gallery/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [huge-it](https://wordpress.org/support/users/huge-it/)
 * (@huge-it)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/centering-elements-within-container/#post-5304648)
 * Dear customer as you are commercial version user please contact us on [info@huge-it.com](https://wordpress.org/support/topic/centering-elements-within-container/info@huge-it.com?output_format=md)
   as your problem may not associate with other users.
 *  Thread Starter [MasterOmok](https://wordpress.org/support/users/masteromok/)
 * (@masteromok)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/centering-elements-within-container/#post-5304800)
 * I will email to follow up, but this is most likely an issue that will affect 
   others as well. I assume that I am not the only one that would like the elements
   centered within the container. Also, this would not be limited to the commercial
   version – it would affect free version as well.
 *  Plugin Author [huge-it](https://wordpress.org/support/users/huge-it/)
 * (@huge-it)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/centering-elements-within-container/#post-5304811)
 * Dear [@masteromok](https://wordpress.org/support/users/masteromok/) Huge-IT Portfolio
   Gallery works the way it should. We have set it to take the whole width of its
   parent element. Maybe we add such functionality when some other users post about
   it too.
 *  [danielandrewkhong](https://wordpress.org/support/users/danielandrewkhong/)
 * (@danielandrewkhong)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/centering-elements-within-container/#post-5304841)
 * Hi,
    I seem to be having this problem too. The items just keep aligning themselves
   to the left. Any luck MasterOmok? I’m pretty sure this can be solved with just
   a slight CSS tweak
 *  Thread Starter [MasterOmok](https://wordpress.org/support/users/masteromok/)
 * (@masteromok)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/centering-elements-within-container/#post-5304843)
 * What I did is not ideal because it requires multiple updates if we decide to 
   change the thumbnail size or padding any time later.. But what I did is force
   the container to be a size of three thumbnails and centered that container. Our
   thumbnail is 222px wide.
 * #huge_it_portfolio_content {
    width: 740px; margin: 0 auto; }
 * Then for when the screen resolution will only allow 2 to be shown on the same
   line, I made the container smaller to only fit two.
 * [@media](https://wordpress.org/support/users/media/) only screen and (max-width:
   900px) and (min-width: 600px)
    #huge_it_portfolio_content { width: 500px; margin:
   0 auto; }
 * And then when it goes down to one only being able to be shown I make the container
   smaller again.
 * [@media](https://wordpress.org/support/users/media/) only screen and (max-width:
   599px) and (min-width: 1px)
    #huge_it_portfolio_content { width: 240px; margin:
   0 auto; }
 * Like I said, not ideal. As well as not a true center because of the the padding.
   Honestly it should just be a setting in the plugin area to center the items versus
   left aligned.. but that’s up to the developers. So a hacky approach is needed
   to center them, but it works.
 * If you want to see how it looks, this is the site I was having issues with initially:
   [http://www.wcitservices.com/portfolio/](http://www.wcitservices.com/portfolio/)
 *  [eganet](https://wordpress.org/support/users/eganet/)
 * (@eganet)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/centering-elements-within-container/#post-5304893)
 * Hi Master Omok, I used your code in my child theme but it didn’t work. I’m surprise
   it works perfectly on your site. I guess I’m doing something wrongly or is it
   because I’m using the free version.
    Thanks for your input.
 *  [support-huge-it](https://wordpress.org/support/users/support-huge-it/)
 * (@support-huge-it)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/centering-elements-within-container/#post-5304894)
 * Dear users free or pro. i would like to inform you that we have beta version 
   of Portfolio already centered, but without category & sorting buttons. If it 
   is ok for you, please contact us by [info@huge-it.com](https://wordpress.org/support/topic/centering-elements-within-container/info@huge-it.com?output_format=md)
   and we will send you the file
 *  [eganet](https://wordpress.org/support/users/eganet/)
 * (@eganet)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/centering-elements-within-container/#post-5304895)
 * I contacted the support team yesterday and I received the version of portfolio
   already centered. Great plugin and great support!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Centering elements within container..’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/portfolio-gallery_eb4c4e.svg)
 * [Portfolio Gallery - Photo Gallery](https://wordpress.org/plugins/portfolio-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/portfolio-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/portfolio-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/portfolio-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/portfolio-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/portfolio-gallery/reviews/)

## Tags

 * [center](https://wordpress.org/support/topic-tag/center/)
 * [huge it](https://wordpress.org/support/topic-tag/huge-it/)

 * 8 replies
 * 5 participants
 * Last reply from: [eganet](https://wordpress.org/support/users/eganet/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/centering-elements-within-container/#post-5304895)
 * Status: resolved