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 trialShabeer Shums
109 Pointshow do i write css
i was half way through the initial stage and i'm told to make a css change out of nowhere. Please help?
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<p>Welcome to My Web Page!</p>
</body>
</html>
2 Answers
Jonathan Tyler
2,504 PointsYou begin writing your CSS under your styles.css tab.
Don't worry, it's pretty simple. The challenge is asking you to change the color of your <h1> to purple. So in your CSS tab, write your selector which is h1. Then use the color property to change its color.
h1 { color: purple; }
Don't forget the important of beginning and ending a new rule with your opening and closing curly brackets.
Alexander Davison
65,469 PointsIn the code editor, you can switch between the index.html
tab and the styles.css
tab. You should write this:
h1 {
color: purple;
}
In the styles.css
tab.
Here's how the CSS turns all H1
s to purple:
- We select all
H1
s by usingh1
. - Inside of the
{}
, we specify how we want to style allh1
s. Whyh1
s? That's because we told CSS we wanted to styleh1
s in the selection. - We set the
color
property to the color value ofpurple
. Remember to end the line with a semicolon! It's like ending a sentence with a period to CSS.
I hope this helps
Happy coding!
~Alex