CSS3 :nth-of-type() 选择器

可以设定第几个元素的样式

案例
css

.qrcode img {
    margin-top: 30px;
}

.qrcode p:nth-of-type(1) { /*第一个p*/
    font-size: 16px;
    color: #b03305;
}

.qrcode p:nth-of-type(2) { /*第二个p*/
    font-size: 14px;
    color: #777;
}

html

<div class="qrcode" id="qrcDiv">
    <img src="{sh:$publicnumber_info['qrcode']}" width="250px" height="250px">
    <p>长按二维码图片,识别图中二维码 关注</p>
    <p>关注我们,获取更多服务</p>
</div>

效果

原文地址:https://www.cnblogs.com/jiqing9006/p/5347318.html