css之给某兄弟模块添加特定样式

使用 :nth-child

<template lang="pug">
msg-container
    .homePageLeft(slot="left")
        .homePageLeftTop
            echats
        .homePageLeftTop
            echats
    latestNews(slot="right")
</template>

  设置css样式如下

.homePageLeft {
    .homePageLeftTop {
        background: rgba(255, 255, 255, 1);
        border-radius: 4px;
        &:nth-child(1) {
            margin-bottom: 19px;
        }
    }
}

  

posted @ 2020-07-03 18:10  Y迎code  阅读(292)  评论(0)    收藏  举报