What kinds of Styles

  • Tag: For specific tags. The style is applied automatically to the corresponding tag.
    • h1 {font:arial;font-size:12px;color:red} ( is automatically applied to all h1 tags)
  • Class style: any name as long as there are no spaces. Use only letters, numbers, underscores and hyphens
    • .fred ( is applied in the tag <h1 class ="fred")

<html>
<head>
<meta charset="UTF-8">
<title>Tag styles and class styles</title>
    <style type="text/css">
        h1 {font:arial;font-size:12px;color:red}
        .fred {font-style: italic;color:green}
        </style>
</head>

<body>
    <h1> This has a tag style applied</h1>
    <p class="fred">This has the fred class style applied</p>
</body>
</html>

tag and class styles