javascript - 网站未检测到我在 SCSS 上创建的形状
问题描述
我正在按照 Web 开发教程创建登录页面。我正在使用 CSS、HTML 和 JS 的组合。我的网站不会检测到我尝试使用 SCSS 绘制的导航栏。它是深蓝色的,位于右上角。以下是到目前为止该项目的代码。
索引.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- displays site properly based on user's device -->
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/dist/style.css">
<title>Frontend Mentor | Easybank landing page</title>
<!-- Feel free to remove these styles or customise in your own stylesheet -->
<style>
.attribution { font-size: 11px; text-align: center; }
.attribution a { color: hsl(228, 45%, 44%); }
</style>
</head>
<body>
<header class="header">
<nav class="flex flex-jc-sb">
<a href="/" class="header__logo">
<img src="images/logo.svg" alt="Easybank" />
</a>
<a href="#" class="header__menu">
<span></span>
<span></span>
<span></span>
</a>
</nav>
</header>
<div class="attribution">
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
Coded by <a href="#">Your Name Here</a>.
</div>
<script src="/app/js/script.js"></script>
</body>
</html>
样式.scss
@import "variables";
@import "globals";
@import "header";
_globals.scss
hmtl {
font-size: 100%;
box-sizing: border-box;
}
*, *::before, *::after {
box-sizing: inherit;
}
body {
margin: 0;
padding: 0;
font-family: 'Public Sans', sans-serif;
line-height: 1.3;
}
/// Flexbox
.flex {
display: flex;
&-jc-sb {
justify-content: space-between;
}
&-jc-c {
justify-content: center;
}
&-ai-c {
align-items: center;
}
}
_headers.scss
.header {
nav {
padding: 24px;
}
&__menu { // Mobile Menu
> span {
display: block;
width: 26px;
height: 2px;
background-color: $darkBlue;
&:not(:last-child){
margin-bottom: 3px;
}
}
}
}
解决方案
推荐阅读
- visual-studio-code - Visual Studio Code中的差异语法突出显示?
- data-modeling - 当数据模型成为数据噩梦时
- c++ - 我应该包括
? - c# - .Net Core SignalR 无法在启动时添加或使用
- python - pandas.DataFrame.groupby.nunique() 不会删除 groupby 列。这是一个错误吗?
- text - 如何使用日文标题构建 SSRS 报告
- postgresql - spring boot JPA在找到空属性时返回空对象,例如日期为空
- sql - MS 服务器上的 TSQL 中的 STRING_SPLIT 创建具有重复值的列表。为什么?
- java - 如果 JSON 在对象中有重复键,如何将 Json 对象映射到 pojo
- http - 使用绝对 URL 而不是绝对路径的 Http 消息在使用 IIS 时会出现 404 错误