1. Technology

Protect Your Digital Photos Online

What HTML Can't Do

By

As the Web Design / HTML Guide, I get lots of questions on how to do things with HTML. Sometimes it's as easy as telling people about my frames tutorial, but other times I have the unpleasant task of explaining that that request can't be done with HTML.

You can't use HTML to do any of the following. Instead you have to use some other technology or technique to take care of them.

  • Protect the source or images of your HTML
  • Make HTML forms do something
  • Password protect a Web page or directory
  • Change images or text when the mouse rolls over it
  • Open link in a new, differently sized window

Protect Digital Images and Your HTML Source Code

When you post something on the Web, you run the risk that someone is going to steal it. In fact, just last week, I found a site that had stolen one of my articles and posted it on their site without permission. This is a fact of the Web.

And when it comes to HTML source code, while it is possible (with JavaScript) to make it difficult for people to see your source, there really isn't anything in HTML that can't be duplicated with a little effort. However, if you really want to make it more difficult for your readers to view the source or right click on images, you can use a JavaScript to prevent it.

You only need one line to prevent right clicking in Firefox and Internet Explorer (Opera ignores this and other no-right-click scripts). This line of JavaScript will block both right clicking and accessing the right-click menu from the keyboard. It will not block viewing the source or downloading images in other ways.

<body oncontextmenu="alert('You may not right click'); return false;">

Keep in mind that while that script will stop some people from stealing your digital photos and HTML source there are many ways to get around it.

What Else HTML Can't Do

Previous Features

©2014 About.com. All rights reserved.