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 trialjohn knight
Courses Plus Student 9,155 PointsQuestion
I Am using an a special text-editor called atom then when i tried to launch the code that is in my text editor It does not launch. Why?. Notice: when it launches the website it shows nothing only plain website.
john knight
Courses Plus Student 9,155 PointsHere's the code, Brandon
<!DOCTYPE html>
<html>
<head>
<title>Hassan Saeed Portfolio</title>
<meta charset="utf-8">
<link rel="stylesheet" href="main.css">
</head>
<body>
<h1>hello world!</h1>
<em>~Emphasized text </em>
<Script src="main.js"></script> </body> <html>
Brandon Benefield
7,739 PointsWell first things first, your opening <script>
tag has a capitalized S. So your page will not link to your JS file.
Secondly, have you tried doing this directly inside the treehouse workspace? I'm getting eveything that's in your HTML from the bold 'hello world!' to the '~Emphasized text' underneath it.
Once again, you have not let me know if you are manually opening the html file yourself. What I mean is, are you double clicking the html file, or are you using a command from atom?
Lastly, just to help others read your code and to make your posts look nicer (which makes others want to help you more), you should reference the "Markdown Cheatsheet" beneath the add comment section. It will help you format your code so instead of a jumbled mess of code, you get
<!DOCTYPE html>
<html>
<head>
<title>Hassan Saeed Portfolio</title>
<meta charset="utf-8">
<link rel="stylesheet" href="main.css">
</head>
<body>
<h1>hello world!</h1>
<em>~Emphasized text </em>
<Script src="main.js"></script>
</body>
<html>
Also I'd like to add that you have over 1,800 points in HTML, are you really asking this question or is this a joke?
john knight
Courses Plus Student 9,155 PointsNo am used for treehouse workspaces so i this is my first time using a text editor like this got me?
1 Answer
Cole Atkinson
2,854 PointsHey John, since you are now working on your local machine instead of an online workspace, relative paths will not work. So for instance, you will need to replace
<link rel="stylesheet" href="main.css">
With the actual path to your css file, for instance:
<link rel="stylesheet" href="C:\Sample\Documents\css\main.css">
I'm 99% sure this is your issue, can you let us know?
Brandon Benefield
7,739 PointsActually you can reference your stylesheets, and JS files relative to where your HTML file is located. If his CSS file is located in the same directory as his HTML file then href="main.css"
works just fine and is a lot nicer to read.
Brandon Benefield
7,739 PointsBrandon Benefield
7,739 PointsI'm having a fairly difficult time trying to figure out what it is exactly that you are asking. So you're using atom, but when you try to open your website, it just plain white background and no text, images etc.? Is there a button or command in atom that lets you open your html file? I've never used atom so I don't know. Have you tried making another html file, adding in a couple of lines of code and opening it?
Post some code, just your HTML. For all we know you set background and foreground colors both to white.