我的CSS文件昨晚工作得非常好,我能够应用我想要的任何更改,但现在我甚至无法更改HTML文件中任何元素的背景颜色或字体。请帮我。我试图让身体颜色变黑,但没有任何改变。 enter image description here
HTML& CSS
body {
margin: 60px;
margin-left: 150px;
margin-right: 150px;
font-family: Avantgarde, sans-serif;
background: black;
}
header {
background: gray;
font-size: 2.0em;
padding: 10px;
color: white;
text-align: center;
}
h2 {
font-size: 20px;
}
#container {
box-sizing: border-box;
width: 100%;
border: 0.5px solid gray;
padding: 25px;
clear: both;
display: table;
}
input {
font-size: 15px;
display: inline-block;
clear: left;
width: 150px;
text-align: left;
}
label {
font-size: 15px;
display: inline-block;
clear: left;
width: 150px;
text-align: left;
}
#submit {
font-size: 20px;
text-align: center;
display: inline-block;
clear: left;
width: 200px;
}
#login {
border: 1px solid gray;
padding: 20px;
padding-left: 40px;
}
#register {
border: 1px solid gray;
padding: 20px;
padding-left: 40px;
}
<header>
Employee Management System
</header>
<div id="container">
<div id="login">
<form action="login.php" method="POST">
<h2>Fill out this form if you have an existing account</h2>
<label>Username:</label>
<input type="text" id="username" name="username" placeholder="your username" required/>
<br>
<label>Password:</label>
<input type="text" id="password" name="password" placeholder="password" required/>
<br>
<label></label>
<input type="submit" value="Login" />
</form>
</div>
<br>
<div id="register">
<form method="POST" action="register.php" class="form" onsubmit="return submitform(this)" id="myForm">
<h2>Register Account</h2>
<label>First Name:</label>
<input type="text" id="fname" name="fname" placeholder="your first name" required/>
<br>
<label>Last Name:</label>
<input type="text" id="lname" name="lname" placeholder="your last name" required/>
<br>
<label>Username:</label>
<input type="text" id="username" name="username" placeholder="your username" required/>
<br>
<label>Password:</label>
<input type="text" id="password" name="password" placeholder="password" required/>
<br>
<label>Confirm Password:</label>
<input type="text" id="cpassword" name="cpassword" placeholder="password" required/>
<br>
<br>
<span class="error"></span>
<br>
<br>
<label></label>
<input type="submit" value="Register" class="submit" />
</form>
</div>
</div>
头部看起来像这样:
<!DOCTYPE html>
<html>
<head>
<title>Employee Management System</title>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
答案 0 :(得分:1)
一个明显的答案是清除缓存或只执行CTRL+F5
。如果您不太清楚如何清除缓存,请查看此网站。