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

How to display my project's code on my website?

I have created a personal website, and now I want to display the code from a project that i have written.

4 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,254 Points

I think the question was about how to display the actual code on the front end, rather than how to use the browser to display it via "view source".

There's one or 2 HTML tags that are useful for this such as the <pre></pre> tag or <code></code>

Hope this helps but let us know if you need anything else :)

Steven Parker
Steven Parker
243,318 Points

You should only need to upload your code to your hosting server. The HTML file is normally named "index.html". The code inside it will reference the CSS and/or JavaScript files(s).

Information about performing the upload should be provided by your hosting company.

First you will need to purchase a domain name: ex. www.example.com.

Then you will need to go to a hosting service and buy server space.

My recommendation to you is to take a look at the course on Treehouse labeled "How to Build a Website" Towards the end of the course, the instructor gives a full tutorial on how to upload your website! Good Luck!

Thank you guys for your answers. After a litle research I found https://craig.is/making/rainbows that solve my problem.