我有一些麻烦,我必须为学校做一个网站。我现在一直在困扰它几天。问题是我的CSS样式没有显示出来。一切都在我的HTML页面上验证,并且CSS页面上的所有内容都会验证,但背景图像和hlsa错误除外。图像名称为“background”,出现此错误:为什么我的CSS样式表不工作?
18标头值错误:background-image解析错误(“Module3/background.jpeg”) 29 h1值错误:颜色0不是颜色值:hlsa(0,0%,0%,0.2)
我的样式表:
body
.gradient
{background-color:#666666;
background-image: linear-gradient(to bottom, #ffffff, #666666);
font-family: Arial, Helvetica, sans-serif;
Margin:0px
;
}
#container { background-color: white;
width:960px;
padding:20px;
margin-left:auto;
margin-right:auto;
box-shadow:5px 5px 5px #1e1e1e;
border-radius:15px}
header {background-image: ("Module3/background.jpeg");
background-repeat: No-repeat;
height:150px;
border:1px;
border-color: black;
border-radius:15px;
}
h1 {font-family:Impact, sans-serif;
font-size:4em;
padding-left:15px;
color: hlsa(0,0%,0%,0.2);}
h2 { font-family: Impact, Sans-serif;
font-size: 2em;
color: black;}
.photo {float:right;}
footer {border-style: solid;
border-top: thick;
font-size:.8em;
font-style: italic; }
我的HTML页面:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My name</title>
<LINK href="Module3/assignment3.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="w3-container">
<!--My required class information
-->
<h1>My Name</h1>
<h2>Education Goals</h2>
<img src="Module3/Sarah.jpeg" alt="Sarah" height="282" width="200">
<ul>
<li>my goals</li>
<li>Graduate from my school</li>
</ul>
<h2>Hobbies/Interests</h2>
<ul>
<li>Reading</li>
<li>Volunteering</li>
</ul>
<h2>Favorite Web Sites</h2>
<ul>
<li><a href="http://www.wikipedia.org">Wikipedia</a></li>
<li><a href="http://www.mainstrike.com/mstservices/handy/insult.html">The Shakespearean Insulter</a></li>
</ul>
<footer>
<p> © <a href="myschoolemail">me</a></p>
</footer>
</div>
</body>
</html>
我不是专家,但我把它的jsfiddle你https://jsfiddle.net/ohL7a8s1/ – ssaltman
查找'背景image'的语法。它是'url()',而不仅仅是括号。 – JJJ
'hsla',而不是'hlsa'; – 0x860111