这是我的 HTML 代码
<!DOCTYPE html>
<html>
<head>
<title>Result</title>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
</head>
<body>
<h1>testing css</h1>
<p>this text shows the paragrpah going under css</p>
<img src = "http://images.wikia.com/glee/images/1/1d/ImaFes.jpg" />
</body>
</html>
这是我的 CSS 代码
h1 {
font-family: Verdana, sans-serif , serif;
color:#576D94;
}
p {
font-size:18px;
color: #4A4943;
font-family: Garamond, serif;
}
img {
height=100px;
width=300px;
border=1px solid #4682b4;
}
我发现的错误是 img 选择器。编辑器在 img 选择器行上显示一个空规则。 希望我没有对 img 选择器做任何错误。
如有语法错误请见谅
最佳答案
你自己看吧。
您正在使用:
img {
height=100px;
width=300px;
border=1px solid #4682b4;
}
应该是:
img {
height:100px;
width:300px;
border:1px solid #4682b4;
}
把等号去掉就是上面的样子
关于html - img 选择器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18709908/