brunjo / rowGrid.js

A small, lightweight JavaScript plugin for placing items in straight rows (jQuery and vanilla JS version) – Demo:
http://brunjo.github.io/rowGrid.js/
MIT License
670 stars 78 forks source link

Centered fixed width? #8

Closed intermedion closed 10 years ago

intermedion commented 10 years ago

How can this be adapted for a centered, fixed width, responsive layout?

brunjo commented 10 years ago

Do you mean something like this: http://codepen.io/brunjo/pen/iuAIv? I only added the following CSS code:

.container {
  max-width: 400px;
  margin: 0 auto;
}
intermedion commented 10 years ago

Yes, exactly, except I also wanted it to break to 2 columns for mobile and stay as is for tablet and desktop. It seems to work ok if I add the following to your example:

@media (max-width: 480px) {
    body {
      width: 300px;
      margin: 0 auto;
    }
} 

http://codepen.io/intermedion/pen/lHgFa