The code you want displayed probably looks like this "<html>" with the arrows. If you wanted to display this (instead of rendering it), you'd have to replace the less than sign with the character entity < and the same with the greater than sign >. If you did "<html>", it'll get rendered and that's not what you want.
Here is some (sample) code that makes the scrollable, non-editable text box:
<pre class="code">
<html>
<head>
<title>Welcome to my site!></title>
</head>
<body>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
</body>
</html>
</pre>
The results that will be displayed on your page:
<html>
<head>
<title>Welcome to my site!></title>
</head>
<body>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
<p>HELLO WORLD</p>
</body>
</html>
To make it look nice, we'll use some CSS. Feel free to use my code and modify to your own liking. My "code" class looks like this:
.code {
width: 450px;
height: auto;
background-color: #000000;
color: #FFFFFF;
font-family: Georgia, "Times New Roman", Times, serif;
border: 1px dashed #FFFFFF;
padding: 6px 3px 6px 3px;
margin-left: 15px;
overflow: auto;
}So, today, I've learned two new things already... favicons and scrollable, non-editable text boxes displaying code!!! KEWLIEZ!
If you happen to understand my tutorial, I'd appreciate you dropping me a comment and letting me know. Thanks!
乾杯!
Cheers!


1 comments:
*muah*
Post a Comment