CSS rules don't apply if I don't put curly braces BEFORE the selector

Tell us what’s happening:

Immediately below the style tag in CSS I have to put empty curly braces in order for CSS rules to apply to the first selector in the code (screenshot attached).

Even though my code works as intended if I put the curly braces in place, I still want to know why they are required since this is something I did not encounter in the practice challenges before the projects.

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36.

Challenge: Build a Tribute Page

Link to the challenge:

That’s odd. You don’t have to use <style> tags in CSS section of the codepen.io. Can you try without using <style> and check if it works or not.

p {
    color: white;

h1 {
    color: red;
1 Like

Yes it does. Thank you. First-timer here :slight_smile:

1 Like

Great :+1: You’re welcome :heart:

1 Like