CSS ID CLASS

With id and class you can specify your own selectors and then use it in your HTML elements

id

The selector id is used to define the style of an element.

In the definition of CSS is identified with "#"

#red { color:red; }

The definition in the HMTL is identified with id

<p id=" red ">Hello World</p>

class

The class selector is used to define a style that will be used by a set of HTML elements, ie, to be reusable for any HTML element

In the definition of CSS is identified with "."

.red {color:red }

The definition in the HMTL identifies with class

<p class="red"> Hello World</p>

You can also define a style for a specific item type HMTL.

For example, to define a style "red" all elements "<h1>" define this CSS:

h1.red {color:red}

The well will be used below:

<h1 class="red"> My headline</h1>