纯css实现的swipe滑块

<view class="swipe">
			<view class="swipe-item">
				<view class="swipe-item-title">
					<span>中超第28轮</span>
					<span>10月21日</span>
					<span>08:00</span>
				</view>
				<view class="swipe-item-content">
					<view class="swipe-item-content-left">
						<image src="../../static/home/team_icon_test.png"></image>
						<span>南通支云</span>
					</view>
					<view class="swipe-item-content-middle">
						<span>1</span>
						<span>-</span>
						<span>1</span>
					</view>
					<view class="swipe-item-content-right">
						<image src="../../static/home/team_icon_test.png"></image>
						<span>南通支云</span>
					</view>
				</view>
				<view class="swipe-item-footer">
					<span><van-icon name="play-circle-o" />集锦回放</span>
				</view>
			</view>
		</view>

css 主要用的是less

.swipe {
		scrollbar-width: thin;
		-ms-overflow-style: none;

		/* Webkit (Chrome, Safari) */
		&::-webkit-scrollbar {
			width: 0.1rem;
		}

		&::-webkit-scrollbar-thumb {
			background-color: transparent;
		}

		&::-webkit-scrollbar-track {
			background-color: transparent;
		}

		width: 100%;
		overflow-x: auto;
		display: flex;


		&-item {
			background: #f8f8f8;
			box-shadow: 8px 8px 10px 0px rgba(0, 0, 0, 0.1);
			border-radius: 6px 6px 6px 6px;
			opacity: 1;
			width: 50%;
			height: 200rpx;
			font-size: 26rpx;
			.d-justify-content-center();
			flex-direction: column;
			padding: 10rpx;
			margin: 10rpx 20rpx;
			position: relative;
			flex-shrink: 0;

			image {
				width: 32rpx;
				height: 32rpx;
			}

			&-title {
				.d-justify-content-sa();
				margin-bottom: 30rpx;

			}

			&-content {
				margin-bottom: 15rpx;
				.d-justify-content-sa();

				&-left,
				&-right {
					flex: .3;
					.d-flex-col();
					text-align: center;
					align-items: center;

					span {
						&:not(:nth-child(2)) {
							width: 100px;
							.text-overflow-ell ()
						}

					}
				}

				&-middle {
					flex: .4;
					.d-justify-content-center();
					align-items: center;
					font-size: 30rpx;
					font-weight: 700;

					span {
						&:nth-child(2) {
							margin: 0 20rpx;
						}
					}

				}

			}

			&-footer {
				.d-justify-content-center();
				align-items: center;
				background-color: #B2301B;
				color: #fff;
				position: absolute;
				bottom: 0;
				width: 95%;
				border-radius: 10rpx;
				padding: 0;

			}
		}

	}
  • 10
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值