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
rebeccacashen
4,602 PointsHow do I include code in my content as text so it is viewable to the reader and not used as actual code?
I'm creating a coding blog as a reference tool. I basically just want code viewable on my page...
'<!DOCTYPE HTML> - you will always include this at the start of your html document'
all that is viewable on my page is '- you will always include this at the start of your html document'
<plaintext> Does seem to work but it is obsolete now and won't work on all browsers... I'll try to find a replacement.
4 Answers
Rich Bagley
25,869 PointsHi Rebecca,
One thing would be to change the opening and closing triangular brackets to be < (less than) and > (greater than).
This Stack Overflow question has a few other suggestions.
Hope that helps :)
-Rich
Argzon Haziraj
Courses Plus Student 14,994 PointsPlease be more specific !
rebeccacashen
4,602 PointsI'm creating a coding blog as a reference tool. I basically just want code viewable on my page...
'<!DOCTYPE HTML> - you will always include this at the start of your html document'
all that is viewable on my page is '- you will always include this at the start of your html document'
rebeccacashen
4,602 PointsThis seems to show the code in the browser without it interpreting it as code... <!doctype html>
Gavin Ralston
28,770 PointsTypically you'll want to use the markdown or code tags your blog software uses.
Otherwise your HTML will get interpreted as...HTML and get rendered rather than shown verbatim.
rebeccacashen
4,602 Pointsrebeccacashen
4,602 PointsThats exactly it :) Thankyou :)
Rich Bagley
25,869 PointsRich Bagley
25,869 PointsNo problem :)
-Rich