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

HTML Introduction to HTML and CSS (2016) Adding a New Web Page Write the CSS

what is wrong with my codes? My webpage looks wrong now...

<!doctype html> <html> <head> <title> Alexandre Barrantes's resume </title> <link rel="stylesheet" href="resume.css">

</head> <body> <img src="https://placeimg.com/200/200/tech" alt="Alexandre Barrantes, Web Developer" class="main-image"> <h1> Alexandre Barrantes, Web Developer</h1> <h2> Summary of Qualifications</h2> <ul> <li> Experience as a Freelancer Web Developer </li> <li> Experience as a Sales Representative at Fido Canada</li> <li> Bachelor in Cumputer Science</li> </ul> </body>

</html>

Are you asking why your code from your style sheet isn't applying to your html file? If so, you should probably start by looking at the 'href="resume.css"' attribute in the link element.

Here is an example for linking a CSS stylesheet to your HTML index root file: <link rel="stylesheet" type="text/css" href="theme.css">

Also, this website might be helpful to you. https://itstillworks.com/create-index-file-7285723.html

Incidentally, check how computer is spelled. : )

5 Answers

Jacek Bialek
Jacek Bialek
18,225 Points

1.........................................................................save it as index.html....................................................................

<!doctype html> <html> <head> <title> Alexandre Barrantes's resume </title> <link rel="stylesheet" href="resume.css"> </head> <body> <img src="https://placeimg.com/200/200/tech" alt="Alexandre Barrantes, Web Developer" class="main-image"> <h1> Alexandre Barrantes, Web Developer</h1> <h2> Summary of Qualifications</h2> <ul> <li> Experience as a Freelancer Web Developer </li> <li> Experience as a Sales Representative at Fido Canada</li> <li> Bachelor in Cumputer Science</li> </ul> </body> </html>

2.............................................................save your .css file in the same folder................................................

3.................................................................................it should work...............................................................................

Jacek Bialek
Jacek Bialek
18,225 Points

Be sure file "resume.css" is in the same folder in which your "index.html" is located.

As jacek was saying. You have a path that says your resume.css file is in the same folder as index.html. If it's not, and say you have it in a folder call css (which is what I usually do) then the path would need to be "css/resume.css". It must be relative to where your index.html file is.

i dont understand when you say that my resume.css is in the same folder as index.html. I dont see the index.htlm. What should i add or erase?

thanks for your help

Ruan Davis
Ruan Davis
7,344 Points

Always remember that your path towards your css should be accurately defined. If you need to step into a folder use the folder name / file name.css.

If your css was located in a sub folder your path from your root directory would be/folder name /sub folder name/ file name.

We are referring to the html file that you are writing in and linking your css sheet to. It is usually saved as "index.html" but you may have named yours something else. That file needs to be at the root of your directory, so not inside another folder. For example, if I create a folder for my webpage, I might create a folder named "myWebpage". If I open that I would see a file which I created and named "index.html". I would have also created a folder called "css" and inside that folder I would create a file named "style.css". That is the css file I would write my main styles in for the index.html file. It would need a link in "index.html" with the path "css/style.css".