javascript - 自动保存时页面闪烁/闪烁(仅在 CSS 文件上)
问题描述
我刚从 Atom 切换到 VsCode,我遇到了这个问题。
我正在编写一个测验测试,因为我正在练习 JS,我发现每次我在 CSS(字符、空格)中输入一些东西时,我都会在很短的时间内看到网页的内容在 HTML 的默认位置(所以,左对齐)。
这很烦人。这只发生在 CSS 上,而不是 HTML 或 JS。
我在这里查看了问题,但至少从我所看到的来看,他们都没有遇到我遇到的确切问题。
在这里我添加了一些照片。第一个没问题,应该是这样,但是在第二个中,当我输入一些随机空格时,它很快就失去了所有的样式。
对于那 1000 秒,CSS 停止工作,每次我按下关键字按钮时它都会停止工作。让你头晕目眩。
这里的代码,也许我做错了什么(?)
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: helvetica;
}
.title {
text-align: center;
}
.title ~ h3 {
text-align: center;
margin-top: 20px;
color: green;
font-size: 1.8em;
}
.questions {
text-align: center;
}
<!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">
<link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<div class="quizCont">
<div class="title">
<h1>Welcome to the most exciting quiz</h1>
<h3>Are you ready to test your abilities?</h3>
</div>
<h3>Here we go!</h3>
</div><br><br>
<div class="questions">
<div class="question1">
<h3>1. What is the capital of the United States?</h3>
<p>a. New York</p>
<p class="quest1">b. Washington D.C.</p>
<p>c. Texas</p>
</div><br><br>
<div class="question2">
<h3>2. When was Google invented?</h3>
<p>a. 1980</p>
<p>b. 2000</p>
<p class="quest2">c. 1996</p>
</div><br><br>
<div class="question3">
<h3>3. What was the year the man walked on the Moon?</h3>
<p class="quest3">a. 1969</p>
<p>b. 1920</p>
<p>c. 2009</p>
</div>
</div>
</div>
<script src="main.js">
</script>
</body>
</html>
解决方案
推荐阅读
- python - 比较来自光栅的两个数组中的值并执行操作
- java - 当我不断收到 HTTP ERROR 500 java.lang.VerifyError 时,是否可以在 App Engine 中使用 Datanucleus 增强的 Java 8 类?
- php - php guzzle 问题与对 wordsAPI 的 requestAsync 调用
- python - Python websocket客户端 - 确定连接是否打开的方法
- python - 你能在 Python 中检索函数的有效参数列表吗
- selenium - 使用 selenium 访问网站时无法与客户端建立 TLS
- blazor-webassembly - 如何从 Blazor WebAssembly 中的 sessionStorage 读取大字符串?我的结果被截断
- c++ - 如何使用支持多个文件的 arduino 创建 Web 服务器?
- sql - 查询以替换 PostgreSQL 中 int 数组中的部分值
- java - Java 程序未显示所需的输出