追格圈子小程序首页列表描述信息单行改多行的方法

追格官方小助手/ 2022年04月19日/ 小程序/ 浏览 1280

追格圈子小程序推荐内容列表描述信息发布时默认是单行,超出隐藏,有些用户希望能够显示多行文字,其实通过简单修改css即可实现,在这里我们来看看如何调整

打开main.scss文件,搜索 .jiangqie-base-intro


.jiangqie-base-intro {
	height: 2rem;
	line-height: 1.5rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 30rpx;
	font-weight: $Q-rich-text-weight;
}


调整为


.jiangqie-base-intro {
	max-height: 4.5rem;
	/* --- max-height 设置最大高度,是line-height的几倍即为几行,这里是3行 --- */
	line-height: 1.5rem;
	margin-bottom: 20rpx;
	/* ---margin-bottom 用于调整与下方内容的间距 --- */
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 30rpx;
	font-weight: $Q-rich-text-weight;
}


如下图,通过简单调整css即可实现,多行显示


发表评论

暂无评论,抢个沙发...

客服 工单