473,394 Members | 1,878 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Showing html code in a web page

What code can I put in a web page to make a browser show a piece of (x)html,
instead of trying to render it?
Jul 24 '05 #1
3 9312
Once upon a time *Armand Karlsen* wrote:
What code can I put in a web page to make a browser show a piece of (x)html,
instead of trying to render it?


You replace < and > with &lt; and &gt; in the html for e.g
&lt;img src="yourimage.jpg" alt="alt text" /&gt; and it will look like
<img src="yourimage.jpg" alt="alt text" /> on the page

--
/Arne
*I don't reply to top posters!*
Jul 24 '05 #2
"Armand Karlsen" <ar************@zen.co.uk> wrote:
What code can I put in a web page to make a browser show a piece of
(x)html, instead of trying to render it?


If you need to ask, do you think you are competent enough in XHTML
to present HTML code in public? During the years, we have even seen
people who claim to be writing an HTML tutorial and asked how to show
HTML samples. The usual advice is: read a good tutorial before trying
to write one.

(Any good tutorial tells that the characters "<" and "&", if they
appear as data, should be written as "&lt;" and "&amp;", or something
like that. But a good tutorial tells you other things as well, such as
the use of <code> markup and various ways to preserve formatting,
should you wish to do do.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 24 '05 #3
"Arne" wrote in comp.infosystems.www.authoring.html:
Once upon a time *Armand Karlsen* wrote:
What code can I put in a web page to make a browser show a piece of (x)html,
instead of trying to render it?


You replace < and > with &lt; and &gt; in the html for e.g
&lt;img src="yourimage.jpg" alt="alt text" /&gt; and it will look like
<img src="yourimage.jpg" alt="alt text" /> on the page


The above is step 2.

Step 1: Replace any & with &amp;

Step 3: Slap <pre> above the snippet and </pre> below it.
If you want to show a whole page of HTML as text, it's best to tell
your server to offer it as text/plain. Then you don't need to
change a single character. (Does MSIE still ignore "text/plain" and
try to render a page if its name happens to end in ".htm"?)

--

Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
Jul 24 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tor Inge Rislaa | last post by:
Showing an HTML file in part of a Webform Hi I have a Webform with some buttons on the left side of the form. What I want when clicking one of the buttons is to show an HTML document in a part...
1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
8
by: johkar | last post by:
I have two problems I cannot work out in the following tab code with Netscape 6. Problems are marked with all cap comments. One is that the background image is not shown in NS 6 (two places in...
10
by: bessington | last post by:
hey all, i'm having a rather bizarre problem.. the image tag i have declared in my xhtml is not showing in safari / konqueror but showing just fine in Firefox, IE, Opera... this is a complete...
4
by: rsteph | last post by:
I've found a javascript menu download, I've been tweaking it within a testpage, and getting it to look just right. I finally got everything looking right, all I have to do is alter where the links...
7
by: tshad | last post by:
I have a page that is showing as: Page.IsValid = False on postback when my submit button is pressed but none of my Validators have fired so there is no error message. How do I find out what...
1
by: Grimm | last post by:
I am developing an internalk inteface that integrates alot of seperate tools into one interface. The current version uses one Iframe inside a div layer for positioning. Currently the seperate web...
5
by: John Kotuby | last post by:
Hi all, This is my first time trying to creaet and use a custome Web Control in a Web Site project in ASP.NET 2.0 with VS 2005 and VB. I created the control in a separate Web Control Library...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.