-
-
Save pamplozio/b29ff8ad134328a79de5f0e481810b6c to your computer and use it in GitHub Desktop.
CSS-Selectors
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="./styles.css"> | |
<title>CSS Selctor</title> | |
</head> | |
<body> | |
<h1>All CSS Simple Selector</h1> | |
<table> | |
<tr> | |
<th>Selector</th> | |
<th>Example</th> | |
<th>Example Description</th> | |
</tr> | |
<tr> | |
<td>#id</td> | |
<td>#firstname</td> | |
<td>Select element with id="firstname"</td> | |
</tr> | |
<tr class="even"> | |
<td>.class</td> | |
<td>.intro</td> | |
<td>Selects all elements with class="intro"</td> | |
</tr> | |
<tr> | |
<td>element.class</td> | |
<td>p.intro</td> | |
<td>Selects only <p> elements with class="intro"</td> | |
</tr> | |
<tr class="even"> | |
<td>*</td> | |
<td>*</td> | |
<td>Selects all elements</td> | |
</tr> | |
<tr> | |
<td>element</td> | |
<td>p</td> | |
<td>Selects all <p> elements</td> | |
</tr> | |
<tr class="even"> | |
<td>element,element,..</td> | |
<td>div, p</td> | |
<td>Selects all <div> elements and all <p> elements</td> | |
</tr> | |
</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
h1 { | |
font-family: 'Times New Roman', Times, serif; | |
text-align: center; | |
} | |
table { | |
font-size: 20px; | |
width: 50%; | |
margin-left: auto; | |
margin-right: auto; | |
} | |
table th { | |
border: 2px solid black; | |
background-color: lightsalmon; | |
} | |
.even { | |
background-color: darkgray; | |
} | |
th { | |
border: 2px solid black; | |
font-family: 'Times New Roman', Times, serif; | |
} | |
td { | |
border: 2px solid black; | |
font-family: sans-serif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment