Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS How to Make a Website Beginning HTML and CSS Add Style to the Page

A very newbie question about brackets and curly braces.

Why are Curly Braces used in the CSS and Brackets are used in the HTML? Are Curly Braces needed for design edits? or is it just a way to organize content?

I noticed that my color stays blue if I use brackets instead of Curly Braces.

3 Answers

Chris Dziewa
Chris Dziewa
17,781 Points

Both HTML and CSS are languages of their own. The brackets and curly braces here act as containers for grouped content. You will also notice that some languages use semicolons to end lines of code. All of this is dependent on the syntax of the language. In HTML you have a set of tags-opening and closing. Anything inside one of these tags is looked at as being contained within the element. In CSS the syntax tells us we need at least one selector (corresponds to an element in the HTML) followed by a pair of brackets with the properties you would like to set on that element. Language syntax will become clearer the more you use it.

You have potential! The first step to becoming great in something is admitting you are a newb. The second is asking question's

Thanks Chris