Skip to content

Instantly share code, notes, and snippets.

@isaklafleur
Created April 3, 2017 13:09
Show Gist options
  • Save isaklafleur/8f0760e97ac4d63ce5da564ef6e87a7a to your computer and use it in GitHub Desktop.
Save isaklafleur/8f0760e97ac4d63ce5da564ef6e87a7a to your computer and use it in GitHub Desktop.
My CSS & HTML Cheat Cheat
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="style.css" rel="stylesheet">
</head>
<body>
<h1 id="unique">Unique ID</h1>
<h1 class="frequent">To use same style in many places use classes</h1>
<h1 class="frequent">To use same style in many places use Classes</h1>
</body>
</html>
#unique {
color: pink;
}
.frequent {
color: red;
}
@isaklafleur
Copy link
Author

This gist shows that using IDs only update the h1 tag one time, when using classes the html elements that has the same class are both updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment