HTML and CSS Reference
In-Depth Information
At first blush there is nothing wrong, but it turns out the
id
value is used twice, as
demonstrated here:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>
CSS Validation Challenges
</title>
<style type="text/css">
#unique {color: red; font-size: xx-large;}
</style>
</head>
<body>
<p id="unique">
I am the paragraph with id unique.
</p>
<p>
I am not the unique paragraph.
</p>
<p id="unique">
Yet another unique paragraph?
</p>
</body>
</html>
If this document is CSS validated, everything is apparently okay:
However, with HTML validation we see that is actually not the case: