Three Ways to Display Sample Html in a Web Browser

by iStylr
Three Ways to Display Sample Html in a Web Browser
If you’re looking to write about web design and HTML, you’ve no doubt run into this problem. How do you display sample mark-up that the user can see?
The problem is simple. You want to display the sample markup. The user’s browser wants to render it as actual mark up. You need to come up with something to tell the browser – “Hey, this isn’t supposed to be rendered!”
There are a few ways to do this.
First, you could use an xmp tag.
The xmp tag was developed for displaying “example” HTML. Once the browser sees an xmp tag, it stops rendering all HTML until it sees a closing tag.
However, the tag is deprecated. It’s no longer included in the HTML standards – which will prevent your site from validating – and it may not be supported by all browsers. Use at your own risk.
A second, more reliable method, is to include the markup in a textarea box.
When you create a textarea element, you can include text in between the opening and closing tags as “default” text. Any HTML in this text remains unrendered – which allows you to easily display your sample markup.
There are two problems with this, though. First, you can’t include a closing textarea tag within your example – or it will prematurely close the textarea that you are using to display your example. You also cannot style the text at all with css.
The third solution – probably the best – is to escape all of the signs in the sample code.
If you replace
This is by far the surest method of displaying your sample HTML, the only problem is that you need to escape all of the characters. However, you can take a shorcut – use this form to do the escaping for you.
Copy and paste your own code in, and the escaped code will be created on the spot.
I’m the author of Web Cash – a blog about web design, writing, and making cash on the net. You can read more about How to Display Sample HTML, or check out the latest HTML Tutorials.
A PHP and HTML Tutorial in which we processes information from a form using the $_POST[]; functions in PHP and created a table and form. Link for Notepad2: www.flos-freeware.ch
Video Rating: 4 / 5
| Print article | This entry was posted by All4U on August 9, 2010 at 8:42 pm, and is filed under HTML. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |

about 1 year ago
please can you tell me how to this form send to database and how it is display in my web site ….thanks
about 1 year ago
hello …thanks for php help but please can you tell me how to this form send to database and how it is display in my web site ….thanks
about 1 year ago
I Have a form can you help me
about 1 year ago
I followed the tutorial and everything seemed to be working. I tested the page and no matter what age I select it will show as 1-10, any help would be appreciated. The name and email shows up but age always shows as 1-10 even if i select 11-20 or 21-30?
about 1 year ago
@ddamos00 I have no idea lol. It would be something else but I didn’t create the account to upload PHP tutorials at first.
about 1 year ago
Why did you give your self the user name lifeg0eson666?
about 1 year ago
blah blah blah hulala
about 1 year ago
hi everyone,
there is a new social network dedicated to everyone who is interested in Programming,hacking and information technology.It’s a place where you can talk about other people with the same interests as yours,publish your source codes,aski for help,share your personal status.The link is:
nerdz.gotdns.org
Enjoy!
about 1 year ago
Hey guys, I’m doing several videos on PHP Programming videos as well as other languages, if you’re truly interested in learning come check out my channel
High quality tutorials, as well as, high quality explanations.
Subscribe if you like and would like to get my videos as I post them!
about 1 year ago
I would just like to say that learning PHP on youtube is cool and all and there ARE some really neat tutorials, but If you ever felt that you wanna learn all of it quick, Simplephp is a complete guidebook to the php language in an e-book form. It takes all the useful information and displays it then goes on to the more complicated fancy stuff. Good php programmers can make like 125$ an hour so why not learn it and make the money yourself! Its WAY cheaper then all the rest. Here: tinyDOTcc/332n9
about 1 year ago
большое вам спс
about 1 year ago
thanks for uploading the video. for anyone who is having some HTML trouble, you can learn much easier with the site easyhtml . net. its where I learned to code. i hope it helps!
about 1 year ago
thank a lot
about 1 year ago
Hello all! I am also releasing multiple chapters of HTML and XHTML with some basic CSS included. I will release an entire tutorial on CSS later down the road. As well as any tutorials anyone requests. If this offer interests you at all then plz subscribe and stay tuned
about 1 year ago
lol just fix the cellpadding=”2 <—– finish the end quote.
about 1 year ago
wtf u pig?
about 1 year ago
Awts… When i press send, it didn’t display the character that i’ve input on name, email as well as the age…
Please help… thnx..
about 1 year ago
Nice quick tut snippet dude!
about 1 year ago
It didn’t workIt didn’t work to me..:(
about 1 year ago
@valdemaras1 lol
about 1 year ago
u did good i appreciate it
about 1 year ago
lots of thanks
about 1 year ago
Brilliant thanks. Thats very good. Ferrazi you’ve issues what did this guy do?
about 1 year ago
your voice like annoing orange hahahhahahhaa
about 1 year ago
mas o menos