Skip to content

Instantly share code, notes, and snippets.

@heinthanth
Created September 1, 2019 05:30
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 heinthanth/5c6da03ec7535782e671b4fddda52f54 to your computer and use it in GitHub Desktop.
Save heinthanth/5c6da03ec7535782e671b4fddda52f54 to your computer and use it in GitHub Desktop.
CSS Selector
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
nav {
color: blue; /* selection with tag name */
}
.demo1 {
color: red; /* selection with class name */
}
#header1 {
color: gray; /* selection with id name */
}
</style>
</head>
<body>
<nav>a nav bar</nav>
<div class="demo1">
<h1 id="header1">Hello</h1>
<h1>World</h1>
</div>
<div class="demo1">
<h1>Hi</h1>
<h1>Dude</h1>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment