html代码如下:
篮球
篮球
篮球
篮球
CSS代码如下:
.yyjx_row {
width:100%;
display: -webkit-box;
justify-content: flex-start;
align-items: center;
white-space: nowrap;
overflow-x: scroll;
overflow-y: hidden;
padding-bottom: 0.2rem; 兼容ios
&::-webkit-scrollbar { //去除滚动条,设置滚动条的背景颜色为透明
background-color: transparent;
display:none;
}
.yyjx_item {
width: 1.5rem;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
margin-right: 0.2rem;
padding-right: 0;
text-align: center;
img {
width: 100%;
height: 1.5rem;
}
span {
width: 100%;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 0.24rem;
font-weight: bold;
margin-bottom: 0.2rem;
}
}
}