我正在尝试添加右边的填充到水平滚动条中,以确保滚动中的最后一个项目出现在屏幕中心。
以下是我的尝试! 虽然左边填充正常工作,但我不明白为什么右边填充未被应用。
.option-widget {
display: flex !important;
overflow: auto;
padding-left: 40% !important;
padding-right: 40% !important;
}
HTML :
<div className="option-widget">
<IconButton id={selected} className="icon-font" ><img style={{ width: '70px' }} src={image.selected} alt="name" /> </IconButton>
<IconButton id={selected} className="icon-font" ><img style={{ width: '70px' }} src={image.selected} alt="name" /> </IconButton>
<IconButton id={selected} className="icon-font" ><img style={{ width: '70px' }} src={image.selected} alt="name" /> </IconButton>
<IconButton id={selected} className="icon-font" ><img style={{ width: '70px' }} src={image.selected} alt="name" /> </IconButton>
<IconButton id={selected} className="icon-font" ><img style={{ width: '70px' }} src={image.selected} alt="name" /> </IconButton>
<IconButton id={selected} className="icon-font" ><img style={{ width: '70px' }} src={image.selected} alt="name" /> </IconButton>
</div>
任何形式的帮助都将不胜感激。