CSS代码是:
li.block1 img {
display: block;
margin: 0 auto 0 auto;
}
我已经尝试删除 li 并使其成为 .block img。我试过删除 img 并且只有 li.block。我尝试将块更改为块1。我什至尝试更改margin: 0 auto 0 auto
为 just margin: auto
。没有什么变化。CSS 验证器返回错误“Parse Error [ ]”。它甚至没有告诉我错误是什么,也没有告诉我有问题的代码。我检查了文档,看看那里是否有一些不寻常的未显示字符,没有。如果我删除这整个样式代码,错误就会消失。
HTML 部分根本没有任何问题。
这是整个 STYLE 块:
<STYLE>
body {
background-color: #103872;
color:lightseagreen;
font-family:verdana;
}
a:link {
color:seagreen;
text-decoration:none;
}
a:visited {
color:seagreen;
}
a:hover {
color:seagreen;
}
a:active {
color:seagreen;
}
p {
text-align:justify;
}
li.block1 img {
display: block;
margin: 0 auto 0 auto;
}
</STYLE>
编辑:这是使用此代码的 HTML。
<LI class="block1">If everything goes well, you will get this when the installation is complete: <IMG style="padding-top:10px; padding-bottom:10px; height:50%; width:50%" src="Images/complete.png" alt="Installation Complete image"></LI>
我该怎么做才能解决这个问题?