html - img 选择器错误

标签 html css

这是我的 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/

相关文章:

html - 将 CSS 网格与转换结合

html - Bootstrap 响应式搜索引擎布局

javascript - CSS动画暂停并使用javascript播放

html - 核心标题面板 "waterfall-tall" polymer 不会出现

javascript - 将焦点设置在使用 jQuery load 方法导入的其他页面元素上

javascript - document.getElementById().value 返回空字符串而不是文本字段的值

html - 如何从 html 表格的最后一行中删除底部边框?

php - 以逗号分隔的 HTML 表单输入字段

html - 使用 CSS 创建单词部分提升

javascript - 将 text.json 解析为 jquery.animation?