HTML
  Home arrow HTML arrow Page 4 - HTML: Working with Special Characters
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
VeriSign Whitepapers 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

HTML: Working with Special Characters
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2008-02-13

    Table of Contents:
  • HTML: Working with Special Characters
  • Linking to Someone Else’s Website
  • Opening a Link In a New Window
  • How to Create a Mailto Link
  • Special Characters/Entities in HTML

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
    Iron Speed
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    HTML: Working with Special Characters - How to Create a Mailto Link


    (Page 4 of 5 )

    Our last link is the Mailto, which opens the user's email and allows them to send you a message. You can opt for it to include a subject line, as we will do in the sample below:


    <html>


    <body>


    <p>

    <a href="mailto:someone@google.com?subject=Hello%20Buddy">

    Email Me</a>

    </p>


    </body>

    </html>

    This code creates a link inside the words Email Me and creates a subject line for the email that reads: Hello Buddy. Note that when you put a space in between words for your subject, you must use %20 to do so.

    Entities

    Entities are characters in HTML that are reserved for special purposes. Common examples are the &, >,<, double quotation (“) and single quotation (‘). Since these special characters are reserved in HTML, you cannot simply write them as text on your web page, as the browser will misinterpret them. Never fear though, because I am going to teach you how to force your browser to accept them. Take that Internet Exploder!


    <html>

    <body>


    <p>James Payne's Mr. T I Pity the Fool Cereal &#174;</p>



    </body>

    </html>

    The above code will display the following text in your browser:

      James Payne's Mr. T I Pity the Fool Cereal ®

    The code “&#174;” tells the browser to place a Register symbol into the paragraph.

    You will note that there are two ways to enter special characters in HTML. You can do it either by using the Entity Number, as in the above example, or by using the Entity Name, as shown below:


    <html>

    <body>


    <p>James Payne's Mr. T I Pity the Fool Cereal &reg;</p>



    </body>

    </html>

    The up side to using the Entity Name is that it is easier to remember. Unfortunately though, not all browsers support every Entity Name. For this reason it is typically better to use an Entity Number instead.

    More HTML Articles
    More By James Payne


       · Hey, thanks for stopping by to read the new installment of my series on HTML. In...
     

    HTML ARTICLES

    - Another Look at Animation of Geographical Ma...
    - Animation of Geographical Map Regions
    - Changing and Moving Pictures with CSS
    - Clickable Geographical Map Regions
    - Gradient Creation with the HR Element
    - Text on HTML Images: Do it Yourself
    - Custom Buttons in HTML
    - Quick Web Page Menu
    - Maximizing and Restoring HTML Images with th...
    - Maximizing and Restoring HTML Images with th...
    - Handling Hyperlinks and Images in HTML
    - Quick Start with HTML
    - HTML Tips
    - Color Composition and HTML
    - HTML Fonts, Styles, and Headers


    Iron Speed





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway