Home arrow HTML arrow Page 4 - HTML: Working with Special Characters
HTML

HTML: Working with Special Characters


In the last article we discussed formatting, colors, and working with backgrounds. In this episode, we'll learn how to work with links and special characters, called Entities, in HTML.

Author Info:
By: James Payne
Rating: 4 stars4 stars4 stars4 stars4 stars / 2
February 13, 2008
TABLE OF CONTENTS:
  1. · HTML: Working with Special Characters
  2. · Linking to Someone Else’s Website
  3. · Opening a Link In a New Window
  4. · How to Create a Mailto Link
  5. · Special Characters/Entities in HTML

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
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.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials