简体   繁体   中英

Display doctype tag in html

I'm trying to display a few lines of xml in a manual to be copied and pasted. However, I cannot find a way to display

<!doctype login[ ... 

and a few other xml tags. I cannot have extra characters or such, as a client will copy and paste the code. Htmlentities doesn't solve the issue.

Anyone have any ideas?

A solution I found was to put parts of the tag in their own spans.

<span><</span><span>!</span>DOCTYPE <span>></span>

displays a doctype tag properly.

properly

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM