How do I show HTML markup including tags without using the XMP element on an HTML5 website?
The website is made with HTML5 and shows tutorials about HTML, C++ etc.
So I need to show the source code of many programming languages.
The most often used alternative is to use the <pre> or <code> element and escape characters that have a special meaning in HTML. < would become <, > is escaped to >.
According to Can I escape html tags within a class (recreate the xmp tag)?, you can still use the XMP tag. Browsers should still support it, although according to What was the <XMP> tag used for?, <pre> is the preferred element to use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With