Question

I wan't to access a wikipedia page with anchor - I'm not sure if this a 'wikipedia' or HTML related question

Access a single word with an anchor is easy

http://en.wikipedia.org/wiki/Wake-on-LAN#History

But how can I access a header with space?

http://en.wikipedia.org/wiki/Wake-on-LAN#Principle of operation ✗
http://en.wikipedia.org/wiki/Wake-on-LAN#Principle%20of%20operationhttp://en.wikipedia.org/wiki/Wake-on-LAN#Principleofoperation

Was it helpful?

Solution

Basically, space is %20, but wikipedia uses _
http://en.wikipedia.org/wiki/Wake-on-LAN#Principle_of_operation

OTHER TIPS

put underscore for particular heading like http://en.wikipedia.org/wiki/Wake-on-LAN#Principle_of_operation it will take you directly on particular heading.please check it

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top