Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created June 30, 2020 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/e00a3db3886d9d8b35ab2685af804455 to your computer and use it in GitHub Desktop.
Save codecademydev/e00a3db3886d9d8b35ab2685af804455 to your computer and use it in GitHub Desktop.
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