Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created February 17, 2021 03:05
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/f25ddf320014356836eb84916eacd065 to your computer and use it in GitHub Desktop.
Save codecademydev/f25ddf320014356836eb84916eacd065 to your computer and use it in GitHub Desktop.
Codecademy export
<!DOCTYPE html>
<html>
<head>
<link href="/styles.css" type="text/css" rel="stylesheet">
<title>
Cheat Sheet
</title>
</head>
<body>
<h1>CSS Selectors</h1>
<h3>Element Selectors</h3>
<table>
<thead>
<td>Selector</td>
<td rowspan="3">Description</td>
</thead>
<tbody>
<tr>
<td class="selector">Element</td>
<td>selects all the selected elements on the page</td>
</tr>
<tr>
<td class="selector">Group</td>
<td>selects all groups of elements on the page selected</td>
</tr>
</tbody>
</table>
<h3>Class and ID Selectors</h3>
<table>
<thead>
<td>Selector</td>
<td rowspan="3">Description</td>
</thead>
<tbody>
<tr>
<td class="selector">Class</td>
<td>selects all elements with class attribute containing elements with that class</td>
</tr>
<tr>
<td class="selector">ID</td>
<td>selects the element with id attribute value</td>
</tr>
</tbody>
</table>
</body>
</html>
body {
background-color: linen;
font-family: Lucinda Console, Courier, monospace;
}
h1, h3 {
color: DarkOrange;
text-align: center;
}
table {
border: 5px solid CornflowerBlue;
margin-left: auto;
margin-right: auto;
}
.selector
{
background-color: orange;
}
td {
border: 1px solid SlateGrey;
}
thead {
text-align: center;
background-color: DarkOrange;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment