开发者

html anchor: <a>

I just found that <a href="#comment:9"></a> can work the same as <开发者_运维技巧a name="comment:9"></a>,

which is more standard?


One is not more "standard" than the other. They are both part of the HTML spec. The first one is a link to the second one. If you click on

<a href="#comment:9"></a>

then your browser will navigate to the part of the page defined by

<a name="comment:9"></a>

You may see the scrollbar move on your browser when this happens.


The <a href="#comment:9"></a> seems to be more out there thereby preserving the essence of href there rather than name which is better/ideal for the form elements.


If you are attempting to link to a target inside of a web page, you should use # which is standard. This makes the meaning unambiguous. Just because one browser makes the assumption about the later method doesn't mean that all do and that the ones that do now will continue to in the future.

Also here is a link to the Links in HTML documentation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜