HTML 中的导航/链接
Hoe moet je 链接在 html 中制作吗?恩维德?
如何在html中制作导航链接?
Hoe moet je link maken in html? en verder?
How to make navigation link in html?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
正如我从你原来的帖子中了解到的:
As I understood from your original post:
创建文本链接
创建图像链接
To create a text link
To create an image link
我想我们可以做一个更长的解释。
链接的形式为
caption
。这才是看待事物的最简单的方式。target
可以是多种内容:然后
转到锚点 ;
带你去那里。在 XHTML 中,这应该是而不是
name
。在我看来,这是 html 中被忽视的功能之一,最初是为了让文档导航变得更容易而设计的。mailto:[电子邮件受保护]
或ftp://downloads.somesite.com
。尽管最常见的用法是http
,但它不一定是http://
。事实上,您可以自由地使用file://
。Users
在这种情况下stackoverflow.com/questions/123456
会访问 stackoverflow.com/users。
,那么相对寻址方面的所有内容(上面的点)都将变得相对于该基我相信。我不太用它。现在,正如其他人所观察到的,标题可以包含其他项目。字面上的任何内容,例如
或
或
。最后一个案例为您提供了一种创建 css 菜单的方法;如何做到这一点是另一个问题,但重点是,这非常强大。
还有一些其他属性,具体来说
target
最常用的是target="_blank"
,它要求浏览器打开一个新窗口。您也可以将其与 html 框架一起使用,但如果您不知道框架是什么,请忘记我提到过它们。真的。I think we can manage a longer explanation.
A link takes the form
<a href="target">caption</a>
. That's the really simplistic way to look at things.target
can be a number of things:<a name="anchor">
then<a href="#anchor">go to anchor</a>
takes you there. In XHTML this should be<a id="anchor"/>
rather thanname
. This is, in my opinion, one of the overlooked features of html, originally designed to make navigating documents easier.mailto:[email protected]
orftp://downloads.somesite.com
. It doesn't have to behttp://
although the most common use is withhttp
. You are free, in fact, to usefile://
.<a href="../users">Users</a>
in which casestackoverflow.com/questions/123456
would go tostackoverflow.com/users
.<base href="http://someurl" />
then everything in terms of relative addressing, the point above, becomes relative to that base I believe. I don't use it much.Now, as others have observed, caption can contain other items. Literally anything, say
<img/>
or<div></div>
or<li>
. The last case gives you a way to create css menus; how to do that is another question, but the point is, this is pretty powerful.<a>
has some other properties, specificallytarget
The most commonly used one istarget="_blank"
which asks the browser to open up a new window. You can use this with html frames too, but if you don't know what frames are, forget I mentioned them. Really.