3 Things (Almost) No One Knows About CSS

I was quoting your post not the quiz :smile:

Anyway all elements are display:inline by default until the UA applies its own styles so there is always more going on under the hood than you think. :wink:

Here’s another not so straight forward question.

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
table tr > td {
	background:green;
}
table td {
	background:blue;
}
table td:first-child {
	background:yellow;
}
table > tr > td:first-child {
	background:red;
}
</style>
</head>

<body>
<table>
    <tr>
				<td>Test</td>
    </tr>
</table>
</body>
</html>

What colour will the td background be.

2 Likes