Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Chaopin Wen
Chaopin Wen
509 Points

style.css question

Why all the code in the style.css sheet below are commented out but is still readable by program?

/* Theme Name: Twenty Thirteen Child Theme URI: http://http://wordpresstreehouse.com// Description: Child theme for the Twenty Thirteen theme Author: Zac Gordon Author URI: http://wp.zacgordon.com/ Template: twentythirteen Version: 1.0 */

Chaopin Wen
Chaopin Wen
509 Points

What I mean is in "how to make child themes" course start from 2:05. Zac talked about creating child theme and I am wondering why the code in style.css file is still readable by program even though it is commented out. Please see the course below.

https://teamtreehouse.com/library/how-to-make-child-themes-2

4 Answers

Steven Parker
Steven Parker
231,269 Points

None of what you show here is actual CSS code.

I believe you will find the actual code occurs after the comments.

Chaopin Wen
Chaopin Wen
509 Points

What I mean is in "how to make child themes" course start from 2:05. Zac talked about creating child theme and I am wondering why the code in style.css file is still readable by program even though it is commented out. Please see the course below.

https://teamtreehouse.com/library/how-to-make-child-themes-2

Steven Parker
Steven Parker
231,269 Points

The actual code is the line that comes after the comments (on line 11):

@import "../twentythirteen/style.css";

This line actually loads in more code from another file.

But while the comments in this file don't affect the CSS itself, they do have meaning to the Wordpress framework. For more information about that aspect of the file see this discussion of the theme stylesheet in the Wordpress documentation, which was suggested by Jason Anello.

Yusuf Sibila
Yusuf Sibila
1,068 Points

I'm not sure what you mean?

Chaopin Wen
Chaopin Wen
509 Points

What I mean is in "how to make child themes" course start from 2:05. Zac talked about creating child theme and I am wondering why the code in style.css file is still readable by program even though it is commented out. Please see the course below.

https://teamtreehouse.com/library/how-to-make-child-themes-2

Chaopin Wen
Chaopin Wen
509 Points

Thank you for your answer, but if is what you say that the actual code comes after the comments, I tried so when I deleted the comments then the child theme will not been created, it will have error.

Steven Parker
Steven Parker
231,269 Points

The comments do have meaning to Wordpress itself. See my addition to my previous answer.

Chaopin Wen
Chaopin Wen
509 Points

Thank you! Your addition link answered my question.