首页 > 解决方案 > 我是 scss 新手,遇到 scss 代码格式的问题

问题描述

嘿,我是 scss 的新手,我的代码中出现了一些错误。我正在为我的页面使用父类。这是我的CSS

.d-layout {


    .bg-img {
        height: 304px;
        width: 1140px;
    }

    .p-color: {
        color: #A50034;
    }
    .ptd {
        .icon {
            height: 8px;
            width: 8px;
            transform: rotate(-90deg);
        }
        button {
            color: #A50034;
            font-family: "LG Smart_Global";
            font-size: 20px;
            line-height: 28px;
        }
    }

}

错误是SassError: Invalid CSS after " };": expected "}", was ".p-color: {"

标签: csssassless

解决方案


我相信您的 sass 代码的问题是“.p-color”之后的冒号

代码应该是:

.p-color {
    color: #A50034;
}

推荐阅读