Errors on my page when I try to use CSS
Line 8, Column 23: document type does not allow element "STYLE" here If I try to take the line out the format isnt correct, if I leave it in http://validator.w3.org/check gives me an error. Can someone explain or maybe give me the correct way of doing this.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Randy's first html web page !</title>
</head>
<style type="text/css">
body
h1
{
background-color:#6495aa;
margin-right:1350px;
}
h2
{
background-color:#b0c4de;
margin-right:1350px;
}
p
{
background-color:#649fff;
margin-right:1350px;
}
div
{
background-color:#efffff;
}
</style>
<h1> Hello Professor</h1>
<h2> By: Randy White</h2>
<P> I haven't done anything like this before.</P>
<P>Seem开发者_如何学编程s to be ok</P>
<table border="1">
<tr>
<th>Month</th>
<th>Day</th>
<th>Year</th>
</tr>
<tr>
<td>December</td>
<td>1</td>
<td>2010</td>
</tr>
</table>
<a href="http://www.google.com">Visit Google!</a>
</body>
</html>
The style tag should be in the head tag.
style
element can only be a child of head
.
精彩评论