我有未与CSS文件链接的HTML代码。我已经在下面发布了代码。每当我尝试更改CSS文件并保存任何内容时,浏览器预览都不会发生任何变化。我使用了以前使用过的Css代码,并且知道它是正确的。但是该css文件未显示在nrpwser预览中
<!DOCTYPE html>
<html lang="en">
<head>
<title>Moses Saygbe LAb 3 </title><!--Title of page-->
<link rel="stylesheet" type="tex/css" href="style.css">
</head>
<body>
<main>
<form id="apptf" class="header">
<h2>Family Medicine Practice</h2>
<header class="header">
Patient Information
</header>
<fieldset class="header">
<legend>Personal Information</legend>
<div>
<label for="first">First Name</label><br>
<input type="text" name="first" id="first" class="header">
</div>
<div>
<label for="last">Last Name</label><br>
<input type="text" name="last" id="last" class="header">
</div>
<div>
<label for="dphone">Daytime Phone</label><br>
<input type="text" name="dphone" id="dphone" class="header">
</div>
<div>
<label for="ephone">Evening Phone</label><br>
<input type="text" name="ephone" id="ephone" class="header">
</div>
<div id="visit-first">
<label for="visit">Is this your first time visiting our office?</label><br>
<input name="visit" type="radio" id="visit" value="Yes"> Yes
<input name="visit" type="radio" id="novist" value="No"> No
</div>
</fieldset>
<header class="header">
Appointment Information
</header>
<fieldset class="header">
<legend>Appointment Time</legend>
<div>
<label for="appointment">Date</label>
<input type="date" name="appointment" id="appointment" class="header">
</div>
<div>
<label for="time">Time</label>
<select name="time" id="time" class="header">
<option value="8am">8AM</option>
<option value="10am">10AM</option>
<option value="12pm">12PM</option>
<option value="4pm">4PM</option>
</select>
</div>
<div class="moreinfo">
<label for="moreinfo">Please describe the reason for the visit</label><br>
<textarea class="moreinfoh" name="moreinfo" id="moreinfo" cols="10" rows="10">.
</textarea>
</div>
</fieldset>
<button type="submit" value="submit" class="header">Submit</button>
</form>
<footer>
Moses Saygbe 2020
</footer>
<script>
window.onload=function(){ //diable right click
document.addEventListener("contextmenu", function(e){
e.preventDefault();
},false);}
</script>
</main>
这是CSS代码。我尝试重新链接它,在一个新的浏览器中打开。仍然没有任何解决办法。
@charset "utf-8";
html, body{
font-family: Arial, Helvetica, sans-serif;
padding-bottom: 0;
margin: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgb(7, 7, 7);
background: url(../Week3lab/graphic/aldebaran-s-zzi-6FCQtF8-unsplash.jpg) no-repeat
center center fixed;
background-size: cover;
z-index: -1;
}
您错过了/在链接到CSS的末尾。 你应该使用