maxmarinich / react-alice-carousel

React responsive component for building content galleries, content rotators and any React carousels
MIT License
832 stars 91 forks source link

Centering the items #301

Closed AmirAmArA closed 8 months ago

AmirAmArA commented 9 months ago

hey there, ive stumblled upon this package , and I am trying to use it but I can't seem to figure out how to center the items of the slider

image

NoxQ commented 8 months ago

Try centering the divs like this maybe

const items = [
    <div className="item"  align="center" data-value="1">1</div>,
...
];

Or if using Tailwind just use mx-auto

maxmarinich commented 8 months ago

Hi, @AmirAmArA! Use common css.

.item {
  margin: auto;
}
AmirAmArA commented 8 months ago

it appears that I was using disabling scrolling on the X-axis, which didn't allow me to see what was the full problem, a simple width property to align with the viewport width solved the problem width: 100%;