Skip to content

Instantly share code, notes, and snippets.

@stevencombs
Last active December 21, 2015 16:49
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 stevencombs/6336505 to your computer and use it in GitHub Desktop.
Save stevencombs/6336505 to your computer and use it in GitHub Desktop.
Two files demonstrate the use of the class, id and pseudo-class selectors to apply style to all text within the body tags of the html file.
/* A Codecademy Web Fundamentals (CSS Selectors) assignment
Dr. Steven B. Combs, coding novice */
.fancy {
font-family: cursive;
color: violet;
}
#serious {
font-family: Courier;
color: #8C8C8C;
}
body :nth-child(4) {
font-size: 26px;
}
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title>Result</title>
</head>
<body>
<!--Add your HTML below!-->
<h3 class="fancy">Steven</h3>
<p class="fancy">This is a fancy paragraph for this example</p>
<p id="serious">This is a serious paragraph</p>
<p>This is a nth-child paragraph</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment