HTML入门教程 - 8.链接(Links)
来源:互联网 发布:知乎 yuhang liu 编辑:程序博客网 时间:2024/05/18 21:43
到现在为止,我们已经可以创建出一个独立的网页使用前面我们所学的知识点,确实是非常的不错,但是这一节我们学习的是链接来是你做的网页融入到网络中。
"HTML"中的”H“和”T“表示的是”hypertext“(超文本),基本上就是系统的文字链接。
锚文本(anchor tag (a))使用来定义一个链接的,但是你同样可以增加一些其他的内容来这个锚文本 - 链接的目的链接。
示例代码显示:
<!DOCTYPE html><html><head> <title>My first web page - BESTSG</title></head><body> <h1>My first web page</h1> <h2>What this is</h2> <p>A simple page put together using HTML</p> <h2>Why this is</h2> <p>To learn HTML</p> <h2>Where to find the tutorial</h2> <p><a href="http://blog.csdn.net/bestsg">BESTSG</a></p></body></html>
实际显示如下:
My first web page
What this is
A simple page put together using HTML
Why this is
To learn HTML
Where to find the tutorial
BESTSG
如上所示,链接的标签定义为“href”属性。链接可以是绝对的链接也可以是相对的链接。
绝对链接:
<a href="http://blog.csdn.net/bestsg">BESTSG</a>
相对链接:
<a href="index.html">BESTSG</a>
链接不必指向其他的HTML文件,他同样可以指向网络中的任意文件。
注意:链接同样可以发送一个用户请求去同一页面的另外一个部分。你可以在标签中增加一个“id”标签属性。
代码示例如下:
<h2 id="go">BESTSG</h2><p>xxx</p><a href="#go">Go to BESTSG</a>
当你点击这个“Go to BESTSG”的链接时,页面将会滚动到“h2 id=“go”的位置。
- HTML入门教程 - 8.链接(Links)
- HTML Links,html的链接,大家都知道的
- 链接对象links
- HTML::LinkExtor, links(), parse_file()
- Linux - 硬链接(Hard Links)和符号链接(Symbolic Links)
- iOS Universal Links(通用链接)
- iOS Universal Links(通用链接)
- HTML入门教程
- HTML入门教程
- HTML 入门教程
- HTML入门教程
- Email html format jump links.
- jQM note:links behaviour 链接行为
- Confluence 分享链接(Shared Links)蓝图
- VBA 查子链接 check child links
- Markdown 语法(4)- Links 链接
- iOS 9 通用链接(Universal Links)
- 通用链接(Universal Links)实践笔记
- Qt Creator计时器实现
- Understanding OpenStack Authentication: Keystone PKI
- 根据字符串动态调用对象的方法
- Android 检测SD卡应用
- emacs配置颜色主题
- HTML入门教程 - 8.链接(Links)
- 在 VC6.0 下设置 Unicode 编译环境
- Ljung-Box q 统计量
- 进制转换的方法
- Qt笔记之计时器
- Windows7下手动搭建Apache+PHP+MySQL
- 不同服务器的数据库(mysql、SqlServer)间数据迁移
- iOS开发中使用[[UIApplication sharedApplication] openURL:]加载其它应用
- python正则表达式介绍及使用方法