开发者

Html: link to specific section of my page

Zend app.I have a link in page1 pointing to specific sec开发者_JS百科tion in page2:

<a href="mysite/index/index/#comments">link!</a>

my section "comments":

<div name="comments">here my comments</div>

This is not working.And the link is loading the page without targetting to the specified div. Where Am I wrong?

thanks

Luca


There is no name attribute for div elements. Fragment identifiers are defined as referencing either a elements via their name (old style, use it if you need to support Netscape 4) or any element via its id (modern style).

<div id="comments">here my comments</div>


try

<div><a name="comments">here my comments</a></div>

or

<div id="comments">here my comments</div>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜