How to Make HTML Without Text Format (pre tags and tag code)

Text HTML Tutorial Part 8: How to Make HTML Without Text Format (pre tags and tag code)

In the HTML, to display the text in order to perform with the space and the characters in the original (text with no formatting) we need a custom tag, the tag<pre>. If in ordinary tags, HTML will ignore the spaces between the characters (if there is more than one space, respectively), the text inside the tag <pre> will be displayed with the 'what'.

HTML Text In this tutorial we will discuss about How to Make HTML Text Format Without using the <pre> and <code> .

Tag <pre> To Make Preformatted Text HTML

<Pre> tag stands for Preformatted Text.As the name implies, this tag is used for text 'yet formatted. If the text is inputted into the <pre>, the HTML will display the text in accordance with the 'what'. Text will be displayed according to how the text is created, including the existing spaces.
<Pre> tag belongs to the group of block-level element, so that will be displayed in a new line, separate from the existing text before this tag.
Here is an example of how to write and use <pre> tag in the HTML:

  <! DOCTYPE html>
 <Html>
 <Head>
 <Title> Learn HTML in Duniailkom </ title>
 </ Head>

 <Body>
 <H3> I'm learning HTML in Duniailkom.com </ h3>
 <Pre>
 Spaces in part 

 This will be displayed
 
 with what
 
 </ Pre>
 </ Body>

 </ Html> 

Example of How to Make Text Without HTML format - pre tag


As seen, the space will still be shown as written. Also the type of
font used is usually the font type "monospace" which has
the same character length for each letter.

<Pre> tag is also often used to create a sample program. The entire
sample code in this duniailkom appear within <pre>. But we have to convert the characters
"<" and ">" into the character HTML Entity. 

<Code> for Writing Code

As the name implies, the <code> is intended to insert code into the HTML.Generally, the web browser will display the text inside the tag <code> equals the font tag <pre>, ie witha monospacedfont, but with the difference that the <code> will remove all spaces are more than one.

<Code> includes a group of inline-level element, and follows the contours of the existing text.

Here is an example of how to write and use <code> in HTML:

  <! DOCTYPE html>
 <Html>
 <Head>
 <Title> Learn HTML in Duniailkom </ title>
 </ Head>

 <Body>
 <H3> I'm learning HTML in Duniailkom.com </ h3>
 <P> HTML stands 
 <Code> Hypertext Markup Language </ code> </ p>
 </ Body>

 </ Html> 

Example of How to Create Without Text Format in HTML - the code tags
From the examples it can be seen the difference of the<pre> and <code>. <Pre> tag is a block element, while the<code> is an inline element. <Pre> tag will display the entire text without reformatting spaces, but in the <code>,if found space characters with more than 1, then only one is used.



In addition to using the <pre>and <code>, the HTMLversion of 4:01 has the <tt>which will produce the same display with <code>. The <tt>stands Teletype, and will be displayed with the font "monospaced".
HTML5 declare the <tt>:deprecated, which means that it is advisable to use, and is not likely to be supported web browser. You may each find this tag, especially in the old site.

0 Response to "How to Make HTML Without Text Format (pre tags and tag code)"

Post a comment

Bila Ada posting yang kurang, atau error atau yang lainnya, silahkan tinggalkan komentar agar artikel/post di perbaiki.
Jangan Lupa Cek Box "Notify Me" agar tahu komentar kamu dibalas oleh saya.

If there are any posts that are missing, or error or anything else, please leave a comment for the article / post to be fixed.
Do not Forget Check Box "Notify Me" to know our comments replied by me.

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel

loading...