HTML
  Home arrow HTML arrow Page 3 - 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  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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
     
     
    ADVERTISEMENT


    HTML: Working with Special Characters - Opening a Link In a New Window


    (Page 3 of 5 )

    So far the links we have created have loaded in the same browser window. This is okay if we are linking to pages within our own site. But what about when we link to someone else’s site? Or what if we just want to display a page with a small bit of information? Loading the page in a new window allows the user to view whatever page they want, without leaving our site.

    To create a link that will open in a new window, we use the following code:


    <html>

    <body>


    <a href="somepage.htm" target="_blank">New Window</a>


    <p>

    Setting the target to _blank forces the page to open in a new window.</p>


    </body>

    </html>

    The above code displays the text New Window and stores the link to somepage.htm. When the user clicks the link, it will open a new browser (this occurs because we set the target as _blank), which displays the samepage.htm.

    Link to a Target on the Same Page

    If you are creating a page with an index on it or a page with a bunch of sections, you can use an anchor to link to specific sections of that page.


    <html>

    <body>


    <p>

    <a href="#Apples">Apples</a>

    </p>


    <p>

    <a href="#Bananas">Bananas</a>

    </p>


    <h2>Section 1</h2>

    <p>blah blah blah</p>


    <h2>Section 2</h2>

    <p>blah blah blah</p>


    <h2>Section 3</h2>

    <p>blah blah blah</p>


    <h2><a name="Apples">How to Eat Apples</a></h2>

    <p>blah blah blah</p>


    <h2><a name="Bananas">How to Eat Bananas</a></h2>

    <p>blah blah blah</p>


    <h2>Section 6</h2>

    <p>blah blah blah</p>


    <h2>Section 7</h2>

    <p>blah blah blah</p>


    <h2>Section 8</h2>

    <p>blah blah blah</p>


    </body>

    </html>

    The above code creates two anchor tags (<a href="#Apples"> and <a href="#Bananas">) with name attributes (><a name="Apples"> and ><a name="Bananas">). When the user clicks either the word Apple or Banana, they are transported to the section How to Eat Apples or How to Eat Bananas respectively.

    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

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    Stay green...Green IT