微信小程序text标签

最近在做小程序,使用<text>标签的时候发现里面的文本text-family不生效,

经过试验,发现直接在text标签的class设置不生效,可以在外层包一个父元素就可以设置了。

<view class="info">
  <text class="text1">文本1</text>
</view>
.info{
  width: 100%;
  height:640rpx;
  background: #fff;
  z-index:10;
  font-family:"宋体";
  margin-top:20rpx;
}
.text1{
  font-size:30rpx;
  float:left;
}
posted @ 2018-08-16 10:57  琪思妙想  阅读(1092)  评论(0编辑  收藏  举报