HTML images, absolute paths, and relative paths, linking

Source: Internet
Author: User

HTML images
标签可以在网页上插入一张图片,它是独立使用的标签,通过“src”属性定义图片的地址,通过“alt”属性定义图片加载失败时显示的文字,以及对搜索引擎和盲人读屏软件的支持。

Absolute path and relative path

Like an external file that inserts a picture on a Web page, you need to define a reference address for the file, a reference to an external file that also includes an external stylesheet, JavaScript, and so on, with a reference address divided into absolute and relative addresses.

绝对地址:相对于磁盘的位置去定位文件的地址相对地址:相对于引用文件本身去定位被引用的文件地址

The absolute address will not be found in the overall file migration because the disk and the top-level directory changes, the relative path does not have this problem. Relative path definition tips:

“ ./ ” 表示当前文件所在目录下,比如:“./pic.jpg” 表示当前目录下的pic.jpg的图片,这个使用时可以省略。“ ../ ” 表示当前文件所在目录下的上一级目录,比如:“../images/pic.jpg” 表示当前目录下的上一级目录下的images文件夹中的pic.jpg的图片。
HTML links
<a>标签可以在网页上定义一个链接地址,通过src属性定义跳转的地址,通过title属性定义鼠标悬停时弹出的提示文字框。<a href="#"></a> <!--  # 表示链接到页面顶部   --><a href="http://www.itcast.cn/" title="跳转的传智播客网站">传智播客</a><a href="2.html">测试页面2</a>

Define scrolling jumps within a page

An element of "id" or "name" is defined within the page and can be linked to its page scroll position via a tag, provided the page is high enough, has a scrollbar, and the element is not at the top of the page, otherwise the page will not scroll.

<a href="#mao1">标题一</a>............

HTML images, absolute paths, and relative paths, linking

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.