0

I like to use an obviously dummy domain name in a sample url, and put < > around it to emphasize it should be replaced. Unfortunately this is interpreted on StackExchange in a way that hides the whole domain name, displaying http:///rest/of/url. What is the right syntax to escape the < and > characters so they and their contents are displayed?

2 Answers 2

4

The short answer is that you can use HTML entities:

  • > &​gt;
  • < &​lt;

Additionally, the brackets are reserved when using preformatted/code markup:

  • <some text here>

But for examples, the better practice would be to the IANA reserved domains, as they will never point to a live website, and search engines will not try to browse them.

  • example.com
  • example.net
  • example.org

RFC 2606 reserves additional top-level domains which may be appropriate:

".test" is recommended for use in testing of current or new DNS related code.

".example" is recommended for use in documentation or as examples.

".invalid" is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.

The ".localhost" TLD has traditionally been statically defined in host DNS implementations as having an A record pointing to the loop back IP address and is reserved for such use. Any other use would conflict with widely deployed code which assumes this use.

1
  • Note also that you have other options for adding emphasis. e.g. If you surround part of your text with '**', it will appear in bold. Surrounding part of your text with backticks puts a grey box around it.
    – mc0e
    Commented Apr 4, 2015 at 1:09
0

You could write them in between a certain symbol.

<div>

If you click edit on this page, you will see it.

1
  • It's called a backtick, and you can simply show it in the screen by putting it in between two spaces, like ` this.
    – Mr Lister
    Commented Mar 29, 2015 at 7:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .