码迷,mamicode.com
首页 > Web开发 > 详细

HTML学习笔记——图片显示、图片跳转、图片相对路径

时间:2015-07-21 09:04:15      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:

1>显示图片、用a标签实现点击图片跳转、地图标签/点击图片上固定区域跳转

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>

    <!-- 图片 -->
    <img src="dog.jpg" title="一只狗" alt"这是一只狗" usemap="#dogmap" />
    
    <!-- 用a标签实现点击图片跳转 -->
    <a href="http://www.baidu.com" target="_blank"><img src="dog.jpg" width="300" height="500" title="一只狗" alt"这是一只狗"/></a>

    <!-- 地图标签/点击图片上固定区域跳转 -->
    <map name="dogmap">
        <area shape="circle" coords="185,198,69" href="http://www.baidu.com" target="_blank" />
        <area shape="circle" coords="385,198,69" href="http://www.sina.com" target="_blank" />
        <area shape="rect" coords="50,50,100,100" href="http://www.sina.com" target="_blank" />
        <!-- 依次写各个点的坐标 -->
        <area shape="poly" coords="0,0,0,50,50,0" href="http://www.hao123.com" />

    </map>


</body>
</html>

2>index图片相对路径

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>

    <!-- ../代表往上反一层 -->
    <img src="../cat.jpg" />

    <!-- 相对路径 -->
    <img src="images/dog.jpg" />
</body>
</html>

 

HTML学习笔记——图片显示、图片跳转、图片相对路径

标签:

原文地址:http://www.cnblogs.com/tonglin0325/p/4663297.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!