Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I display html tags inside an HTML document?

Tags:

html

pre

I simply want to create something like that:

<strong>blah blah</strong>

I've been trying to do this for a long time though for some reason whenever I put the code and the pre tags they don't do what they should. They do unformat the content - I don't see any formatting, though the tags don't appear. For example, I wrote :

<pre><b>abc</b></pre>

The abc is appearing not bold, but I can't see the tag itself. How can I do that? I don't want to use entities like &fdaf; because I am not writing the incoming text

like image 532
Ariel Avatar asked Mar 23 '11 13:03

Ariel


People also ask

How do you display HTML tags in HTML?

</pre> tag is use to display or show the all language coding as same on HTML webpage. We will use HTML <pre> .. </pre> tag to display or show the coding on our HTML webpage.

How do you embed HTML in HTML?

Embedding an HTML file is simple. All we need to do is use the common „<link>“ element. Then we add the value „import“ to the „rel“ attribute. Using „href“ we attach the URL of the HTML file, just like we are used to when it comes to stylesheets and scripts.


1 Answers

Use the <xmp> tag, e.g.

<xmp>
  <html>
    <body>This is my html inside html.</body>
  </html>
</xmp>

You can also add styles and formatting inside <xmp> as well.

like image 111
Fuzzy Analysis Avatar answered Oct 13 '22 18:10

Fuzzy Analysis