Welcome, Guest. [ Log In ]
Question   Can I hide my HTML code?
Search KBase

Related Links:

Top 5 in this Area:
1. Creating an index page
2. HTML Basics
3. Can I hide my HTML code?
4. Which web authoring (HTML-generating) programs do you support?
5. What is CSS, and do you support it?

Can I hide my HTML code?
Can I hide my HTML code so that people can't see it with 'View Source'?

There really is no way of doing this. If you put up a web page, the source code is visible. That's the nature of the Web.

Although there is no way to make your HTML code invisible to visitors, there are a few tricks you can do to make viewing it a little more work:

  • Use external style sheets (CSS) [what's that?] for formatting. Your formatting (text size, color, etc.) won't be visible in the source code, but the rest of your code will be.
  • Add lots and lots of carriage returns at the top of your HTML page. This will give the illusion of a blank page, when a visitor does 'View Source.' However, a scrollbar will appear on the visitor's page, and most people will know to just scroll down.
  • Use frames. However, the main page will contain reference to the component pages, which most people will know how to access outside of the frameset using their browser.
It's difficult to imagine what information might be so secret that you would want to protect it from your visitors. Chances are, those kinds of secrets shouldn't be written into the code of your web page in the first place.

Last updated: Aug 16, 2002.