排行榜样式

在这里插入图片描述

<div style="padding: 10px;">
	<el-row :gutter="20" class="section-top">
		<el-col :xs="24" :sm="12" :lg="6" class="">
			<el-card class="panel-card" :body-style="{padding: '10px'}">
				<div slot="header" class="clearfix">拉新裂变<el-link type="info" style="float: right" @click="linkTo('/member/referrer')">明细 >></el-link></div>
				<div class="list"
					v-for="(item, index) in newUserList" 
					:key="index" 
					:class="{last : index + 1 == newUserList.length}">
					<span class="index" :class="'index'+(index+1)">{{index+1}}</span>
					<!-- 没有统计时占空位 -->
					<div class="label-empty" v-if="JSON.stringify(item) == '{}'"> -</div>
					<div class="label" v-else>
						<div class="img"><img :src="item.HeadImgURL" class="img" /></div>
						<div class="name">
							<h4>{{item.CustName}}</h4>
							<h5>{{item.Mobile}}</h5>
						</div>
					</div>
					<div class="value" v-if="JSON.stringify(item) != '{}'" >{{item.Total || 0}}人</div>
				</div>
			</el-card>
		</el-col>
	<el-row>
<div>
<style>
.section-top {
	padding: 20px;
}

.list {
	padding: 5px 0;
	display: flex;
	flex-flow: row nowrap;
	justify-content: center;
	align-items: center;
	border-bottom: 1px solid #ddd;
	&.last {
		border-bottom: none;
	}
	.index {
		color: #fff;
		text-align: center;
		width: 20px;
		height: 20px;
		line-height: 20px;
		background: #9195A3;
		border-radius: 4px;
		&.index1 {
			background: #FE2D46;
		}
		&.index2 {
			background: #F60;
		}
		&.index3 {
			background: #FAA90E;
		}
	}
	.label {
		font-size: 13px;
		flex: 2;
		display: flex;
		flex-flow: row nowrap;
		justify-content: center;
		align-items: center;
		.img {
			margin: 0 5px;
			img {
				width: 35px;
				height: 35px;
				border-radius: 50%;
			}
		}
		.name {
			flex: 1;
		}
		h4,h5 {
			margin: 0;
			font-weight: normal;
		}
	}
	.value {
		flex: 1;
		text-align: right;
	}
	.label-empty {
		flex: 1;
		height: 35px;
		line-height: 35px;
		font-size: 13px;
		text-align: center;
	}
}
.clearfix:before, .clearfix:after {
	display: table;
	content: "";
}
.clearfix:after {
	clear: both;
}
</style>	
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是一个简单的排行榜样式的 HTML+CSS 实现示例: ```html <!DOCTYPE html> <html> <head> <title>排行榜</title> <style> body { font-family: Arial, sans-serif; background-color: #f2f2f2; } .container { max-width: 800px; margin: 0 auto; padding: 20px; background-color: #fff; box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); } h1 { text-align: center; color: #333; margin-bottom: 20px; } .table { width: 100%; border-collapse: collapse; margin-bottom: 20px; } .table th, .table td { padding: 10px; text-align: left; border-bottom: 1px solid #ddd; } .table th { background-color: #f2f2f2; font-weight: normal; } .table tr:nth-child(even) { background-color: #f2f2f2; } .table tr:hover { background-color: #ddd; } .rank { font-size: 24px; font-weight: bold; color: #333; margin-right: 10px; } .name { font-size: 18px; color: #333; margin-right: 10px; } .score { font-size: 18px; color: #999; } </style> </head> <body> <div class="container"> <h1>排行榜</h1> <table class="table"> <thead> <tr> <th>排名</th> <th>姓名</th> <th>得分</th> </tr> </thead> <tbody> <tr> <td><span class="rank">1</span></td> <td><span class="name">张三</span></td> <td><span class="score">99</span></td> </tr> <tr> <td><span class="rank">2</span></td> <td><span class="name">李四</span></td> <td><span class="score">90</span></td> </tr> <tr> <td><span class="rank">3</span></td> <td><span class="name">王五</span></td> <td><span class="score">80</span></td> </tr> <tr> <td><span class="rank">4</span></td> <td><span class="name">赵六</span></td> <td><span class="score">70</span></td> </tr> <tr> <td><span class="rank">5</span></td> <td><span class="name">钱七</span></td> <td><span class="score">60</span></td> </tr> </tbody> </table> </div> </body> </html> ``` 在这个示例中,我们使用了一个容器 `<div>`,包含一个标题 `<h1>` 和一个表格 `<table>`。表格中包含表头 `<thead>` 和表体 `<tbody>`,每个数据行使用 `<tr>` 表示,每个单元格使用 `<td>` 表示。在每个单元格中,使用 `<span>` 包裹排名、姓名和得分,并使用 CSS 对它们进行样式设置,使它们看起来更美观。 你可以将上述代码保存为一个 HTML 文件,并在浏览器中打开它,查看效果。希望这个示例能对你有所帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值