Register  |  Login



Question

Status: Closed Points: 25 Time: 11:11 - Jul 12, 2006  

john2

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">?

Answer Discussion
Answer Summaries

 

Q&A System for Websites and Corporate Collaboration

Advertisement

  • Generates significant organic traffic for websites
  • Saves companies money, resources, and time

rcastagna

Date:: Jul 12, 2006

Time:: 16:02

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

john2

Date:: Jul 26, 2006

Time:: 14:03

Served my needs, thanks a lot.

Question Answered

This question has been closed, 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 the Summary Area.

Answer 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:

Forgot Your Password?

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

Answer 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:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top HTML Experts

View More

Rank

Expert

Points

1.

rcastagna

1022

2.

jgivoni

928

3.

nidhi

875

4.

xarcus

240

5.

john2

170

6.

danmacryan

125

7.

Anpanman

75

8.

multani.sarbjit

75

9.

PeterNZ

75

10.

roger.berbel

75

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




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



Language Options

English:

www.quomon.com

Español:

www.quomon.es