V
V
Vitya Podpriklopolny2018-02-25 14:28:03
css
Vitya Podpriklopolny, 2018-02-25 14:28:03

How to align blocks to the center of the container?

5a929c2af14ad801057797.png
In general, there is a block with elements.
Isotope plugin is used

.work-items
        display: flex
  flex-wrap: wrap
  justify-content: center


JS

var $grid = $('.work-items').isotope({
    itemSelector: '.work-container_item'
  });
  $('.work-buttons').on( 'click', 'button', function() {
    var filterValue = $(this).attr('data-filter');
    $grid.isotope({ filter: filterValue });
  });

everything is perfect, the plugin works, filters the content, BUT
when the screen narrows, the following happens:
5a929cd2a6779801687201.png
the block itself is in the center, but the elements go in turn, and since they have a fixed height and width , they are transferred to the new one when they reach the end of the line.
How to make sure that these 3 blocks that fit in were in the center of the page?
Maybe there is a property in the plugin, or somehow through css?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2018-03-02
@kutirie

margin: auto ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question