Can someone please tell me if there is a certain attribute i can use to show code snippets or large sections of code on my site? Like on forums you can use [ c o d e ] [ / c o d e] to show code. I tried using <code>TEXT HERE</code>
and also <pre>TEXT HERE</pre>
but neither work like i want them to.
Please help soon, thanx.
paste your code that you want displayed into notepad. Use replace to change the following
< to <
> to >
Put the code on the page where you want it, and it will not be read as html.
Also, If your using a automated service such as a forum (PHP ONLY) you can use this:
//Pulls Message From Textarea On Submit
$message = $_POST['message'];
// Replaces < With <
$message = str_replace("<", "<", $message);
// Replaces > With >
$message = str_replace(">", ">", $message)
thanks alot!!! ;D
Not sure desire...
To make simple html visible on a web page <xmp></xmp> ???
QuoteTo make simple html visible on a web page <xmp></xmp>
xmp is a deprecated tag and should not be used anymore.
Bad Thinking but if browsers still digest it?
I have not tried XMP in a long time.
Where's there a list of no-no stuff? (for education)
Was not <br> going obsolete?
QuoteWas not <br> going obsolete?
I don't remember anything about <br> becoming obsolete.
QuoteBad Thinking but if browsers still digest it?
I have not tried XMP in a long time.
Browsers are not obliged to support it anymore. Some may still accept it if they want to.
QuoteWhere's there a list of no-no stuff? (for education)
W3Schools (http://www.w3schools.com/tags/) has a list of HTML tags and shows which ones are deprecated.
gezzzz I'm still using things like <center> <font....
I guess bad practice but if the latest browsers support them......---===
The best way to go nowadays in coding HTML is using XHTML. Basically its just a cleaner and stricter version of HTML. You can learn about XHTML here... http://www.w3schools.com/xhtml/default.asp
QuoteThe best way to go nowadays in coding HTML is using XHTML.
It is important to be careful when using XHTML. This document (Sending XHTML as text/html Considered Harmful) (http://hixie.ch/advocacy/xhtml) explains the problems it can cause.
One of the major problems blocking the use of real XHTML is that Internet Explorer still doesn't support it and IE 7 won't either. To be processed as XHTML, a page must be sent with the application/xhtml+xml MIME type and IE doesn't accept that.
Why don't you just put it in a textarea? Then you even have a scrolly box.
<textarea cols='50' rows='6'>
TEXT HERE
</textarea>
cols = colums, how wide it is (usualy a LOT more than rows)
Rows = rows, how tall it is.