---
title: "Discussion on \"Introduction to writing better CSS with BEM\" | Hashnode"
description: "Discussion on \"Introduction to writing better CSS with BEM\". If you enjoy writing CSS or don't, chances are you've had your own share of spaghetti CSS. This is usually common especially when dealing with pretty large projects.\nBasically, there are two problems we face when writing CSS. First, is the naming pro..."
url: "https://hashnode.com/posts/introduction-to-writing-better-css-with-bem/5d3c2a5f8516f72c614dd359"
---

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

Discussion

# [Introduction to writing better CSS with BEM](https://hashnode.com/post/introduction-to-writing-better-css-with-bem?utm_source=hashnode&utm_medium=feed)

If you enjoy writing CSS or don't, chances are you've had your own share of spaghetti CSS. This is usually common especially when dealing with pretty large projects. Basically, there are two problems we face when writing CSS. First, is the naming pro...

Jul 27, 2019 · hashnode.com  
Read the article

-   [#css](https://hashnode.com/tag/css)
-   [#bem](https://hashnode.com/tag/bem)
-   [#web-design](https://hashnode.com/tag/web-design)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#html](https://hashnode.com/tag/html)

## Written by

[Adavize Hassan](https://hashnode.com/@ozorku)

@ozorku · Lagos, Nigeria

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

Lifelong learner

## Responses 3

Markdown supported · ⌘↵ to post

[Kevin Falencik](https://hashnode.com/@kfalencik)

[Aug 1, 2019](https://hashnode.com/posts/introduction-to-writing-better-css-with-bem/5d3c2a5f8516f72c614dd359/comment/5d430b0a2d29b6d720913453)

Get a block in there and fix the "\_\_outline" class man...

[Adavize Hassan](https://hashnode.com/@ozorku)

[Aug 2, 2019](https://hashnode.com/posts/introduction-to-writing-better-css-with-bem/5d3c2a5f8516f72c614dd359/comment/5d430b0a2d29b6d720913453#reply-5d443aa433c9db9423e11aca)

Hi Kevin, kindly explain please. Thank you.

[Mostafa Salama](https://hashnode.com/@mostafatourad)

[Jul 30, 2019](https://hashnode.com/posts/introduction-to-writing-better-css-with-bem/5d3c2a5f8516f72c614dd359/comment/5d40ca4cb59ff2cb51d25d55)

very good , you explained BEM in a very easy way .

[Adavize Hassan](https://hashnode.com/@ozorku)

[Jul 31, 2019](https://hashnode.com/posts/introduction-to-writing-better-css-with-bem/5d3c2a5f8516f72c614dd359/comment/5d40ca4cb59ff2cb51d25d55#reply-5d418a38b4f847bd59310aa9)

Thank you Mostafa. I'm happy it is easy to understand

[Paul M. Watson](https://hashnode.com/@paulmwatson)

[Jul 29, 2019](https://hashnode.com/posts/introduction-to-writing-better-css-with-bem/5d3c2a5f8516f72c614dd359/comment/5d3f4448ea67aca069f051b7)

Thanks Adavize. In your example why is "\_\_outline" an element and not a modifier like "--danger" when both are just modifying the "button" block?

[Adavize Hassan](https://hashnode.com/@ozorku)

[Jul 30, 2019](https://hashnode.com/posts/introduction-to-writing-better-css-with-bem/5d3c2a5f8516f72c614dd359/comment/5d3f4448ea67aca069f051b7#reply-5d4059c77ee40d1e6c3869b5)

That's a pretty great question Paul. Well, while both **outline and --danger are modifications of the button block the** outline is a part of the button block and can have its own modifier while the --danger is a modifier of the button block and cannot have a modifier as it is a modifier itself.

[Paul M. Watson](https://hashnode.com/@paulmwatson)

[Jul 31, 2019](https://hashnode.com/posts/introduction-to-writing-better-css-with-bem/5d3c2a5f8516f72c614dd359/comment/5d3f4448ea67aca069f051b7#reply-5d414b574c94739f0e31ecd9)

An even better answer, thanks Adavize.

[Adavize Hassan](https://hashnode.com/@ozorku)

[Jul 31, 2019](https://hashnode.com/posts/introduction-to-writing-better-css-with-bem/5d3c2a5f8516f72c614dd359/comment/5d3f4448ea67aca069f051b7#reply-5d4189bbb4f847bd59310aa5)

I'm glad you're satisfied.
