【发布时间】:2019-10-04 01:40:01
【问题描述】:
我正在 YouTube 上的 DesignCourse 上做一个关于 SVG 剪辑路径 的教程,在我的 .scss 文件中我有很多样式,但第 38 行之后的样式甚至不适用当我检查他的代码时,我看到他的代码和我的一样,我不知道为什么这些样式不适用。我尝试切换到隐身模式并切换浏览器,但没有任何帮助 (我在 Visual Studio Code 和浏览器控制台中没有收到任何错误)。
这是该教程的链接:https://www.youtube.com/watch?v=x9_ULV1vjQE&list=WL&index=42
这是我的 .scss 文件:
@import url('https://fonts.googleapis.com/css?family=Nunito&display=swap');
body, html {
height: 100%;
}
body {
margin: 0;
font-family: "Nunito";
background: #220954;
}
.wrapper {
position: relative;
overflow: hidden;
nav {
width: 20%;
float: right;
background-color: #5923c6;
height: calc(100vh - 4em);
font-size: 1.4em;
line-height: 1.5em;
color: white;
padding: 2em;
//clip-path: url("#clipPath");
ul {
list-style-type: none;
padding: 0;
a {
text-decoration: none;
display: block;
padding: 1em 0;
font-weight: bold;
color: white;
}
p {
color: red;
}
}
}
h1 {
color: white;
margin: 2em;
font-size: 5em;
position: absolute;
top: 0;
left: 0;
}
button {
position: absolute;
top: 0;
right: 0;
margin: 2em;
font-size: 1.4em;
background: none;
border: 3px solid purple;
color: white;
padding: 1em;
cursor: pointer;
outline: none;
&:hover {
background: rgba(0, 0, 0, 01);
}
}
}
这是我的html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CLIPPY</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<button id="open">Open Nav</button>
<div class="wrapper">
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About Me</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">Contact</a></li>
</ul>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Dolorem recusandae aperiam est nulla veritatis magnam dolores, totam perspiciatis unde, mollitia vel exercitationem quas reprehenderit qui deserunt? Illum ipsam eveniet exercitationem?</p>
</nav>
</div>
<h1>Bro, wooooooahh</h1>
</body>
</html>
【问题讨论】:
-
你的 sass 正好有 38 行。
-
在我的编辑器中显示它有 73 行长。我的括号错了吗?
-
那你没有复制你所有的sass
-
你必须向下滚动 sass 代码,因为还有更多
-
添加新样式后,你有没有把那个scss代码编译成css?