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 trialClayton Bowland
2,874 Pointswriting rules in css
how do i write a rule in class="main-pg">
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<p class="main-pg"><My amazing website</p>
</body>
</html>
4 Answers
martinjones1
Front End Web Development Techdegree Graduate 44,824 PointsIn the challenge click on the Styles tab, you will then be able to add the CSS rules.
Rhys Kearns
4,976 PointsStyles tab like Martin Jones said or you can do inline css and do <styles></styles> in the head and type your styles in there, but dont do this if you have a .css document
Clayton Bowland
2,874 Pointsdo i go to the styles.css page? and i reviewed video and im still not getting it right.
Rhys Kearns
4,976 PointsYes styles.css page is where you would write your css - What are you trying to do with css?
Donald Morman
1,050 PointsThere's also an extra < before My amazing website. Once you correct that and make the necessary changes on the .css sheet. You should be good to go.
Rhys Kearns
4,976 PointsOk i just did the challenge to see what was wrong -
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<p class="main-pg">My amazing website</p>
</body>
</html>
.main-pg {
border: 4px solid red;
}
Thats the challenge done - you only needed to create the rule for the second challenge which is .main-pg {} and then third challenge is to make a border 4px wide solid red.
Clayton Bowland
2,874 PointsClayton Bowland
2,874 Pointsthanks ,worked