-
-
Save codecademydev/e00a3db3886d9d8b35ab2685af804455 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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