Skip to main content

IDs and Classes

Introduction: This is the second part in my CSS Styling tutorials, in which I will tell you about IDs and Classes. What Are IDs? The Identification names are one option to link the HTML elements to the relevant CSS styling options. One alternative to this is using Classes - which I cover after this. Giving HTML Elements IDs: To give an HTML element an ID, all we do is set the attribute within the opening tag, just like any other attributes...
  2. <p id="MyID">Hi</p>&#13;
Styling IDs: To style IDs, all we need to do is use a hashtag/pound sign (#) before the ID name, followed by two (one opening, and

Add new comment