473,657 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9328
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.infosystem s.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
2443
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 of the Webform (as if it was a Frame page). Any suggestions? (I am an VB programmer) T.I.Rislaa
1
840
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 controlling the visibility of columns in the DataGrid control. The problem usually comes down to one fact. The DataGrid has a property called AutoGenerateColumns. The default value is "True". This means that when AutoGenerateColumns is set to True,...
8
1986
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 CSS). The second problem is that the top right rounded corner is not showing up in the Tier 2 tabs. Could you have a look and tell me if it is possible to correct? This code seems to work fine in IE 5+ and Firefox. Note that since I can't post...
10
2150
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 mystery and I have been scouring every book / resource I can find but haven't come up with an answer. any one have any ideas? all other images in site showing fine - but they are declared as background images in the css. the site is:...
4
2168
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 navigate to. Before I do that I'm trying to get it put into the actual page I want to use it in; right now I've been using a blank html page to test it with. I've done everything just like it is in the test page, but the menu isn't appearing on the...
7
1795
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 is making the Page invalid? Thanks,
1
5570
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 tools do not have the ability to stay active. As you switch from tool to tool the previous information is lost unless you use a Back button. I need to place multiple div layers with I frames in them that can be shown or hidden based on selection. The...
5
3740
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 project. The original code for that control was written in VS 2003 for .NET 1.1. I created a Web Project and pulled the VB module into the project. I compared the syntax to the VB template classs that was built and it looked very similar. I then...
0
8407
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8319
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.