Html has several tag pairs tags for this purpose:
code, kbd, pre, samp, tt, var
code is an inline pair of tags used to show computer code
kbd i an inline pairs used to represent keyboard input.
<kbd>C:> diskcopy a: b:</kbd>
pre is for preformatted text. It is a block version of code
<pre>
for i=1 to 10
print i, a[i]
next i
</pre>
They render everything between them exactly as written, including indenting. It renders as:
for i=1 to 10
print i, a[i]
next i
samp is inline for printer output
<samp>
Account Total
0001245 $ 12.45
0001365 $ 67.21
0002435 $ 0.00
</samp>
tt is for teletype in a monospace font
var is inline for a variable
All of these are in the xhtml standard as well as the html.
samp shows printer output.
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
For the 'special characters' you might want to try escaping them into HTML entities; or using a different page encoding.
If you don't have too many 'special characters' you can escape them as according to the following table:
http://www.htmlhelp.com/reference/html40/entities/
(There's 3 page of tables [lots of special characters])
If you need to change the encoding (you're using a non-latin character set and, in that case, you have loads of 'special characters') check this out ..
http://www.w3.org/TR/html4/charset.html#h-5.2.1
I'm not sure about the HYPERLINK question.
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64
I think I misunderstood your original question.
If you're output when viewing a page in the browser is plain text (i.e. not formatted at-all as HTML), then there's a couple of potential reasons:
- the page isn't saved with an extension that maps to the HTML mime type (*.html, *.htm are good choices; *.txt is not). EDIT: if your page is created from a VB.NET application, ignore that reason.
- the page is being sent with an incorrect Content-Type header (a correct Content-Type is text/html, a bad one is text/plain)
Do you have an accessible (online) version of the page?
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64
That isn't neccessarily enough.
The Content-type header is truely specified in the head of a HTTP response, not the head of the HTML page. That META tag might result in some subtle changes to a page as it's rendered as HTML, but infact, a page has to be interpretted as (at-least) XML for that META tag to ever get processed.
If your server is sending a HTTP response header of text/plain, followed by HTML code; your page will not be rendered or processed as HTML.
If you could be clearer in your problem (an online example would be useful), then it would be easier to understand what's actually happening.
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64
If you just 'return' a stored zip file or other file to a browser, you don't have to do anything. For example, if a user visits:
http://www.example.com/example.zip
The zip file will ordinarily be handled by the browser's MIME configuration, and the user will be allowed to download it.
However. If your server's MIME handler configuration is messed up, then the server might try to process the file internally, or send the file as if it were page content. You'd have to talk to your hosting provider or look in your server software manual and tell the server NOT try to try to handle zip files, but send them with a valid MIME type.
If you're 'creating' zip data and sending it back from a request, you would need to specify a Content-Type header that described the content =P
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64