Skip to content

Instantly share code, notes, and snippets.

@codecademydev codecademydev/index.html Secret

Created Jun 30, 2020
Embed
What would you like to do?
Codecademy export
<!DOCTYPE html>
<html>
<head>
<title>CSS Selectors</title>
<link href="styles.css" type="text/css" rel="stylesheet">
</head>
<body>
<h1>CSS selectors and declarations</h1>
<table>
<thead>
<tr>
<th>CSS Selectors from Most to Least Specific</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="selector">ID</td>
<td>IDs override class and tag selectors and should therefore be used less often</td>
</tr>
<tr>
<td class="selector">Class</td>
<td>The Class selector overrides the tag selector</td>
</tr>
<tr>
<td class="selector">Tag</td>
<td>The Tag selector is the least specific selector</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>CSS declarations</th>
<th>Description</th>
</tr>
<tr>
<td class="declaration">Color</td>
<td>Allows you to change the color of the text</td>
</tr>
<tr>
<td class="declaration">Font-Size</td>
<td>Can make font size bigger or smaller</td>
</tr>
</tfoot>
</table>
</body>
</html>
th {
border: 2px solid;
color: blue;
}
td {
border: 2px solid;
text-align: center;
font-size: 20px;
}
.selector,
.declaration {
font-family: monospace;
background-color: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.