---
title: "Discussion on \"ID and Class in HTML: What’s the difference?\" | Hashnode"
description: "Discussion on \"ID and Class in HTML: What’s the difference?\". A lot of beginners struggle with the difference between class and ID in HTML. Both are used to identify HTML elements, and both are often used to apply styling, but there are a few key differences.\nSimply put, the rule of thumb is this:\nID is unique,..."
url: "https://hashnode.com/posts/id-and-class-in-html-whats-the-difference/5f24194deab86e5020c3720f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [ID and Class in HTML: What’s the difference?](https://blog.annamcdougall.com/id-and-class-in-html-whats-the-difference?utm_source=hashnode&utm_medium=feed)

A lot of beginners struggle with the difference between class and ID in HTML. Both are used to identify HTML elements, and both are often used to apply styling, but there are a few key differences. Simply put, the rule of thumb is this: ID is unique,...

Jul 2, 2020 · 3 min read · blog.annamcdougall.com  
Read the article

-   [#html](https://hashnode.com/tag/html)
-   [#css](https://hashnode.com/tag/css)
-   [#beginner](https://hashnode.com/tag/beginner)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Anna J McDougall](https://hashnode.com/@AnnaJMcDougall)

@AnnaJMcDougall · Leipzig, Germany

  
[View profile](https://hashnode.com/@AnnaJMcDougall)

Full-stack Developer

## Responses 1

Markdown supported · ⌘↵ to post

[Bolaji Ayodeji](https://hashnode.com/@bolajiayodeji)

[Aug 1, 2020](https://hashnode.com/posts/id-and-class-in-html-whats-the-difference/5f24194deab86e5020c3720f/comment/5f25aaee90ac4260edf35650)

This is amazing, thanks for sharing!
