CSS
button{
margin-top: 4em;
background-color: #ff3a3a;
outline: none;
.active &{
border-bottom: 1px solid #ccc;
border-radius: 0.3rem 0.3rem 0 0;
}
}
我在codepen.io上找到了一个模板网站,但是当我将这些代码恰好放在我的IDE上时-我在“ .active&{”时出错。我还包括这些库,我错过了什么吗?
<link href='https://fonts.googleapis.com/css?family=Lato:300,400,900' rel='stylesheet' type='text/css'>
<link href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/78060/animate.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js">
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js">
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="1.css">
答案 0 :(得分:0)
Sass或scss是服务器呈现的,而不是在浏览器中呈现的。
因此,因为在您的项目中可以使其成为scss文件(通过更改扩展名),然后通过cmd提示将其转换为css
npm install -g sass
安装sass(确保已安装npm,否则请先安装npm)1.scss
button{
margin-top: 4em;
background-color: #ff3a3a;
outline: none;
.active &{
border-bottom: 1px solid #ccc;
border-radius: 0.3rem 0.3rem 0 0;
}
}
sass 1.scss 1.css
中运行此命令
(确保打开或运行cmd提示终端的路径)答案 1 :(得分:0)
我对&唯一了解的是它通常与
<span>×</span
会创建一个“ X”