It's _
for wikipedia links, but...
A more general HTML answer is... web developers can created named anchors (With HTML of the form: <a name="myname">
) with whatever name they like. Different websites do different things.
If an anchor name does have a space in it, that's a bit ugly (I'm inclined to say bad web design actually), but it can be linked to by encoding the space as %20
. Interestingly you cannot encode this as +
, despite that working in the path and query param parts of the URL (this answer has more detail on that)
So what's actually happening on wikipedia, is that the website developers choose to provide named anchors corresponding to every heading on a page, and they choose to name these with the text of the heading (no surprises) except spaces are changed to underscores (which avoids ugly urls and seems like good web design).