再联系小程序时,想让文本只显示一行,试了很多次,都不行,几天不练习,什么都忘了,最后问了同事:
.text{
width: 100%;
height: 100%;
color: greenyellow;
text-align: center;
white-space: nowrap;
overflow: hidden;
}
给text的css属性中,添加:
white-space: nowrap;
overflow: hidden;
两个属性,就实现了。
设置背景:
style="background-image: url({{item.cover_image_url}});"