2012-06-24 16 views
1

I would like to know the semantic meaning of Click Here. What is the meaning of the pound key in this context? I've just added a Spry Menu Bar Widget in Dreamweaver and I can see this notation in the code once the widget is added to the page. I am familiar with constructs with the pound key in a URL such as Here. and then Click Here.的含义。点击第二个元素会将您带到标有“foo”的页面部分。不过,我想知道点击这里的含义,如上所述。特别是,这个构造做什么以及如何使用它?(X /)HTML:页面中某个地方的<a href="#">

感谢,

约翰Goche的

+0

好吧,现在我看到以下链接:http://stackoverflow.com/questions/1971455/href-link-to-question。看起来,Click me.链接只是将浏览器中的页面移动到页面的顶部。这是标准的W3C功能吗?任何将这种行为描述为标准行为的指针将不胜感激。谢谢,John Goche –

回答

5

这是一个片段标识符,正如与#任何其他链接,但在这种情况下,识别该文件的顶部。 <a href="#">通常用于链接JavaScript的链接。

+0

它有点像'/ dev/null'或万维网的File 13。没有人知道......它在哪里?当然,这很容易表现出来。 –

+0

我仍然有些困惑。如果链接附加了JavaScript,那么这个href属性值是如何起作用的?谢谢,John Goche –

+0

它的目的是为了达到目的。我个人更喜欢使用'javascript:void(null)'来完全清楚它没有任何用处。然而,'href'属性对于''标签是必需的链接。 –