【发布时间】:2018-05-21 07:06:47
【问题描述】:
几天以来,我一直在使用 SASS 编写我的 css 文件。 我有两个不同的父母班级,但这两个父母有相同的孩子班级。所以我想用这个 CSS 代码构建我的 SCSS 树:
#header {
position: relative;
width: 100%;
}
#header-g {
position: fixed;
top: 0;
left: 0;
z-index: 300;
width: 100%;
}
#header .l-header-top, #header-g .l-header-top {
height: 55px;
line-height: 50px;
border-top: 5px solid #474747;
background-color: #f0f1f3;
font-size: 16px;
}
我试过这个,但我想我忘记了什么:
#header {
position: relative;
width: 100%;
&#header-g {
position: fixed;
top: 0;
left: 0;
z-index: 300;
width: 100%;
.l-header-top {
height: 55px;
line-height: 50px;
border-top: 5px solid #474747;
background-color: #f0f1f3;
font-size: 16px;
}
}
}
谢谢
【问题讨论】:
标签: css sass compass-sass