小编sha*_*lah的帖子

“npm run -s build”中的“-s”是什么

中的"-s"标志的目的是什么"npm run -s build"?我在 npm 文档中搜索过,但找不到,这是"--silent"标志的别名吗?

npm

7
推荐指数
1
解决办法
4234
查看次数

相对定位伪元素和绝对定位伪元素之间的差异

请考虑以下三种情况:

方案一:

div {
  width: 100px;
  height: 100px;
  background-color: black;    
}

div:before {
  content: "";
  width: 10px;
  height: 10px;
  background-color: darkred;
  position: relative;
}
Run Code Online (Sandbox Code Playgroud)

方案二:

div {
  width: 100px;
  height: 100px;
  background-color: black;    
}

div:before {
  content: "";
  width: 10px;
  height: 10px;
  background-color: darkred;
  position: absolute;
}
Run Code Online (Sandbox Code Playgroud)

方案三:

div {
  width: 100px;
  height: 100px;
  background-color: black;    
}

div:before {
  content: "";
  width: 10px;
  height: 10px;
  background-color: darkred;
  display:block;
  position: relative;
}
Run Code Online (Sandbox Code Playgroud)

方案一(相对位置)未显示darkred伪元素。但是当它变成position:absolute伪元素时,它是可见的。另外,如方案三所示,当我display:block向方案一(相对位置)添加属性时,该元素可见。

为什么relative …

css

5
推荐指数
1
解决办法
814
查看次数

标签 统计

css ×1

npm ×1