SCSS nesting can produce DRYer code by targeting child elements without having to write the parent class. Nesting up to 3 levels deep can help us understand relationships between styles. The SCSS parent selector represents the parent class, so it can DRY up targeting pseudo-elements/classes and be an asset for naming conventions.

.box {

  &-container { /* .box-container, & --> .box*/
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
} transition: all 0.8s ease-in-out;
&:hover {
background-color: #ff4d4d;
transform: rotate(360deg);
}
background-color: #5fb3ce;
border: 1px solid burlywood;
font-size: 1.5em;
width: 200px;
height: 200px;
}

To css:

.box {
transition: all 0.8s ease-in-out;
background-color: #5fb3ce;
border: 1px solid burlywood;
font-size: 1.5em;
width: 200px;
height: 200px; }
.box-container {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh; }
.box:hover {
background-color: #ff4d4d;
transform: rotate(360deg); }

最新文章

  1. 使用ASP.NET Web API Help Pages 创建在线接口文档
  2. struts2 框架处理流程
  3. ionic android双击退出应用和物理返回按钮隐藏键盘的实现
  4. Android开发:第四日番外——Assets文件夹和RAW文件夹区别
  5. centos -bash-4.1$ 不显示用户名路径
  6. 51nod-1686 第K大区间(二分+尺取法)
  7. 【风马一族_Android】android的新发现
  8. python3 学习总结与建议
  9. linux 内核驱动加载过程中 向文件系统中的文件进行读写操作
  10. Delphi String 与wideString 的完美转换
  11. ajax请求响应中用window.open打开新窗口会被浏览器拦截的解决方式
  12. 使用eclipse写C
  13. [HNOI2015]接水果
  14. asp.net动态添加控件学习
  15. CSS:与input相关的一些样式设置问题
  16. Android平台下利用zxing实现二维码开发
  17. mysql-数据库管理安装
  18. Jsp俩大内置对象学习
  19. NYOJ 542 试制品(第五届河南省省赛)
  20. ASP.NET MVC HtmlHelper 类的扩展方法

热门文章

  1. java匿名内部类使用场景列举
  2. JavaScript 进度条重复加载
  3. vue使用marked.js实现markdown转html并提取标题生成目录
  4. Vue Cli 打包之后静态资源路径不对的解决方法
  5. 1.1 Introduction中 Distribution官网剖析(博主推荐)
  6. Android 图片缓存处理
  7. VC error link
  8. PatentTips - Method, apparatus and system for instructing a virtual device from a virtual machine
  9. cmake的使用笔记
  10. Oracle10g中阻塞锁查询更简单