[solved ] Using curly brackets

is there any difference between these uses? I prefer bottom one. Can I use it all the time?

<style>
  .blue-text {
    color: blue;
  }
</style>

vs.

<style>
  .blue-text 
{
    color: blue;
}
</style>
1 Like

There is absolutely zero difference. It’s totally up to your decision :slight_smile:

2 Likes

What about

<style>
  .blue-text {color: blue;}
</style>

Is there a good reason as to why not have everything in the same line?

If you like that better, then you can use it! You can format your code however you like it. If you wanted, you could even write everything minified: <style>.blue-text{color:blue}body{margin:0;padding:0}</style>

It’s just that there’s a standard for developers, and most devs follow it, and it looks like this:

<style>
  .blue-text {
    color: blue;
  }
  body {
    margin: 0;
    padding: 0;
  }
</style>