2

我是新手,尝试使用 react-multi-carousel 构建品牌轮播。图像显示正确,但我想使图像居中。试图写 css 它不适用于轮播。这是如何实现的,或者我必须使用任何其他轮播?`

<Grid item xs={12}>
 <Carousel
   responsive={responsive}
   infinite={true}
   arrows={true}>
       <Image src={abt.logo_carousel.url}responsive/>
       <Image src={abt.logo_carousel1.url}responsive/>
       <Image src={abt.logo_carousel2.url}responsive/>
       <Image src={abt.logo_carousel3.url}responsive/>
 </Carousel>
</Grid>`
4

1 回答 1

1

在标签本身内写样式。像这样

<img src="..." style={{width:300,marginLeft:"auto",marginRight:"auto"}} />

于 2021-07-19T13:10:44.187 回答