To display code in HTML, you can use the <code> tags to enclose the code.To preserve spaces and line breaks, you can use the <pre> tags instead of <code>.To improve the appearance of code, you can use CSS or a library like Prism.js for syntax highlighting.When displaying HTML markup code, you need to use HTML delimiters like < and > to avoid any interpretation by the browser.