Register  |  Login

Question Details    

   Question

Time: 11:11 - Jul 12, 2006     Asked by: john2      Status: Answered      Points: 25   

How do I display HTML code on my webpage as an example without having the browser convert it?

I'm trying to give an example of html code on my page but everytime I write it in, the browser is obviously just reading the HTML and spitting it out as a display instead of just showing the code that I want to show.

In short, how to I put something like

<font face="arial"> as an example but then actually have it show up in the browser as the text <font face="arial">?

Ask a New Question

Become a Quomon Expert

Current Categories

 

Other Questions Needing Answers


   

Answer Discussion
Answer Discussion
Answer Summaries
Answer Summary
 
John,

The "easy" (but sometimes tedious) way of doing this is by using the HTML substitue characters for the less-than and greater-than symbols.

Using your example above, you would code it as follows: &lt;font face="arial"&gt;

Depending on your needs, you could also use the HttpUtility.HtmlEncode available in .NET...this would come into play a bit more if you were fetching the strings from a database, or some other sort of "dynamic" store.

Let me know if this helps...

Ric Castagna

Expert:

rcastagna

Date:

Jul 12, 2006

Time:

16:02

 

Votes: Good (0) | Bad (0)
Login to rate this answer

Served my needs, thanks a lot.

Expert:

john2

Date:

Jul 26, 2006

Time:

14:03

 

Votes: Good (0) | Bad (0)
Login to rate this answer

Question Answered

This question has been answered, and points have been rewarded to the following experts:

rcastagna: 25

You're welcome however to comment or give additional information or if you wish, you have the ability to write an Answer Summary for this question by clicking on the "Answer Summaries" Tab.

 
No summaries have been submitted yet. Want to be the first?



Respond to this question:

New User

  Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:


Forgotten Password

 

New User

  Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:


Forgotten Password

   

"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it


All Questions


Language Options

English:

www.quomon.com

Español:

www.quomon.es

Quomon Blog

blog.quomon.com

Sponsors

Questions and Answers Software
Real Estate Postcards
Marketing Fulfillment