<!DOCTYPE html>
<html>
<head>
<style type="text/css">
p:nth-child(odd)
{
background:#ff0000;
}
p:nth-child(even)
{
background:#0000ff;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>The first paragraph.</p>
<p>The second paragraph.</p>
<p>The third paragraph.</p>
<p><b>Note:</b> Internet Explorer does not support the :nth-child() selector.</p>
</body>
</html>
Không có nhận xét nào:
Đăng nhận xét