微信小程序样式大全(三)

设置属性及样式选择器

 样式组件表格清单

  1. 插入背景图 
<view style='width:200px;height:200px;background-image:url("../../images/icon/icon.png");backgound-repeat:no-repeat'></view> //不能在wxss中使用

 2.使用伪元素

.item {
  position: relative;
}

.item::after {
  content: '已满';
  position: absolute;
  right: 20rpx;
  top: 20rpx;
  width: 100rpx;
  height: 50rpx;
  border-radius: 20rpx;
  border: 1px solid #cc0001;
  font-size: 14px;
  text-align: center;
  line-height: 50rpx;
}

浅谈css的伪元素::after和::before 

3.使用border生成三角形

猜你喜欢

转载自blog.csdn.net/lyp_story/article/details/88247022