老師,如果設計稿是750,視頻中計算方式以375px計算,那么單位都除以2,那么我定義以750px設計稿為準,那是不是直接可以按照設計稿的單位了?
@function?px2rem?($px)?{
??$rem:?75px;
??@return?($px?/?$rem)?+?rem;
}
.header?{
??height:?px2rem(80px);
??width:?px2rem(750px);
??background-color:?red;
??.header-item?{
????float:?left;
????color:?#ffcdce;
????line-height:?px2rem(80px);
????font-size:?px2rem(32px);
????margin:?0?px2rem(24px);
????&-active?{
??????color:?#fff;
??????font-size:?px2rem(34px);
????}
??}
}
2018-07-12
是的,你說的沒錯