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 CSS Foundations Selectors Grouping and Modifying Selectors

Stephen Calderon
Stephen Calderon
4,564 Points

Why is my page showing up blank? Is there something wrong with my code?

Help

Joshua Holland
Joshua Holland
2,865 Points

Please post your code so we can examine it and let you know the issue. This can be done by typing three tildes right before and after you paste your code. It's the ` button just to the left of the number 1 on your keyboard.

Stephen Calderon
Stephen Calderon
4,564 Points
<!DOCTYPE html>
<html>
<head>
    <title>Combinators</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <div class="main">
    <h1>Combinators</h1>
    <a href="#">A direct child of .main</a>
    <p>
        In sit amet consequat dolor. Fusce tempor odio vitae sem elementum, luctus luctus purus iaculis.
    </p>
    <h2>I am a Heading 2</h2>
    <p>
        Lorem
    </p>
    <a href="#">A direct child of .main</a>
    <h2>I am a Heading 2 </h2>  
    <p>

qweqeeeeeeeeeeeeeeeeeeeeeee
</p>
<https://teamtreehouse.com/forum/why-is-my-page-showing-up-blank-is-there-something-wrong-with-my-code#/div>
Stephen Calderon
Stephen Calderon
4,564 Points
body {
    font: 1.1em/1.5 sans-serif;
    padding-top: 20px;
}
.main {
    border: 1px solid;
    margin: auto;
    padding: 10px 20px 20px;
    width: 760px;
}

/* Using Combinators */

.main > a {
    color: red;
}
Stephen Calderon
Stephen Calderon
4,564 Points

Im noticing my css isnt being added,, Ive saved both in the same folder.

4 Answers

Josh Garofalo
Josh Garofalo
2,049 Points

Did you accidentally forget to close a comment up at the top of your page?

Petar Brkovic
Petar Brkovic
8,651 Points

You are missing some important tags html, title

I think you forgot to add head tag in your html file, title and link tags should be inside of head tag.

There are also many things that has to be worked out in your HTML source, Let me look that for you.

Here you go! your HTML file nice & clean :)

<!DOCTYPE html>
<html>
    <head>
        <title>Combinators</title>
        <link rel="stylesheet" href="style.css">
    </head> 
    <body>
        <div class="main">
            <h1>Combinators</h1>
            <a href="#">A direct child of .main</a>
            <p>In sit amet consequat dolor. Fusce tempor odio vitae sem elementum, luctus luctus purus iaculis.</p>
            <h2>I am a Heading 2</h2>
            <p>Lorem</p>
            <a href="#">A direct child of .main</a>
            <h2>I am a Heading 2 </h2>  
            <p>qweqeeeeeeeeeeeeeeeeeeeeeee</p>
        </div>    
    </body>
</html>