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 Getting Started with CSS Adding CSS to a Page

Josie Degler
Josie Degler
2,037 Points

Blank Page

Hello-

I downloaded the project files and am using Sublime 2 (unregistered) to edit along with the videos. However, when I try to open index.html in Chrome or Safari, the page is blank. When I click inspect source, it shows all the HTML.

I am on a Macbook Pro and my updates are up to date.

Thanks!

4 Answers

Josie Degler
Josie Degler
2,037 Points

'''html <!DOCTYPE html>

<html>

<head>

<title>Adding CSS</title>

<link rel="stylesheet" href="css/style.css">

<style type="text/css">

    h1 {

        color: white;

        background-color: #E14607;

    }

</head>

<body style="background-color: #BDD4DE">

<h1>Adding CSS to the Page!</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum non diam justo. Integer accumsan lacus ut quam pulvinar ullamcorper. Proin imperdiet mauris ac lectus blandit adipiscing. Vestibulum placerat mi sit amet odio luctus quis aliquam ante tristique. Praesent sem ligula, rhoncus quis gravida vitae, consequat id odio.</p>

<p>Etiam eros nisl, pretium nec suscipit ac, gravida quis velit. Phasellus adipiscing ultrices lorem, ut porttitor tellus interdum eu. Fusce auctor, felis vitae adipiscing vulputate, tellus odio venenatis lorem, et pretium lectus justo vitae ipsum. Mauris in dictum dolor. Sed fermentum, dolor nec mollis lobortis, eros augue laoreet tortor, vel cursus neque sem ac diam.</p>

<h2>Lorem ipsum dolor sit amet</h2>

<ul>
    <li>Praesent sem ligula rhoncus</li>
    <li>Donec ut ipsum at quam</li>
    <li>Maecenas libero neque accumsan ut</li>
    <li>Donec quis mauris ipsum</li>
</ul>

</body> </html>'''

/****************** style.css ********************/

'''css h2 { color: steelblue; padding-bottom: 10px; border-bottom: 2px dotted; }

ul { color: white; background-color: steelblue; }'''

Josie Degler
Josie Degler
2,037 Points

It's formatting it weird in my browser when I post it as a comment and not including all of the code.

Here are links to the code. https://www.dropbox.com/s/j511msocicebwkp/Screenshot%202014-05-08%2019.11.41.png https://www.dropbox.com/s/kde2d6tqdpicpsc/Screenshot%202014-05-08%2019.11.44.png

Chris Dziewa
Chris Dziewa
17,781 Points

Please paste all of your html code here so we can help you figure it out. Also, make sure you have included the html5 doctype on top before your html tag <!DOCTYPE html>.

Josie Degler
Josie Degler
2,037 Points

It started working! Never mind. Thank you!

Chris Dziewa
Chris Dziewa
17,781 Points

It may work but it is probably forgiving an error. Make sure to close your style tag in the head of the html.